|
From: <txm...@us...> - 2015-04-28 21:55:43
|
Revision: 13050
http://sourceforge.net/p/xoops/svn/13050
Author: txmodxoops
Date: 2015-04-28 21:55:41 +0000 (Tue, 28 Apr 2015)
Log Message:
-----------
Updated
Fixed bugs
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/modules.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/docs/changelog.txt
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/language/english/admin.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/sql/mysql.sql
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/xoops_version.php
Removed Paths:
-------------
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/about.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/footer.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/header.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/index.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/menu.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/objects.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/pages.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/permissions.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/user/index.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/form/simpleform.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/form/themeform.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/helper.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/html/html.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/html/htmlform.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/html/htmltable.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/html/htmltag.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/html/simplelabel.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/tables.php 2015-04-28 16:44:18 UTC (rev 13049)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/tables.php 2015-04-28 21:55:41 UTC (rev 13050)
@@ -155,84 +155,80 @@
}
//
$tables =& $tdmcreate->getHandler('tables');
- if (!isset($tableId)) {
- // Checking if table name exist $tables->isNew()
- $criteria = new CriteriaCompo();
- $criteria->add(new Criteria('table_name', $tableName));
- $table_name_search = $tables->getObjects($criteria);
- //unset($criteria);
- foreach (array_keys($table_name_search) as $t)
- {
- if( ($table_name_search[$t]->getVar('table_name') === $_POST['table_name']) &&
- ($table_name_search[$t]->getVar('table_mid') === $tableMid) &&
- ($table_name_search[$t]->getVar('table_id') === $tableId)) {
- }
+ // Checking if table name exist
+ $criteria = new CriteriaCompo();
+ $criteria->add(new Criteria('table_mid', $tableMid));
+ $table_name_search = $tables->getObjects($criteria);
+ //unset($criteria);
+ foreach (array_keys($table_name_search) as $t)
+ {
+ if( $table_name_search[$t]->getVar('table_name') === $_POST['table_name'] ) {
+ redirect_header('tables.php?op=new', 3, sprintf(_AM_TDMCREATE_ERROR_TABLE_NAME_EXIST, $_POST['table_name']));
+ return false;
+ }
+ }
+ //
+ if (isset($tableId)) {
+ $tablesObj =& $tables->get($tableId);
+ } else {
+ $tablesObj =& $tables->create();
+ }
+ $order = $tablesObj->isNew() ? $tableOrder + 1 : $tableOrder;
+ // Form save tables
+ $tablesObj->setVars(array('table_mid' => $tableMid,
+ 'table_name' => $_POST['table_name'],
+ 'table_category' => $_REQUEST['table_category'],
+ 'table_nbfields' => $tableNumbFields,
+ 'table_order' => $order,
+ 'table_fieldname' => $tableFieldname));
+ //Form table_image
+ include_once XOOPS_ROOT_PATH.'/class/uploader.php';
+ $uploaddir = is_dir(XOOPS_ICONS32_PATH) ? XOOPS_ICONS32_PATH : TDMC_UPLOAD_IMGTAB_PATH;
+ $uploader = new XoopsMediaUploader($uploaddir, $tdmcreate->getConfig('mimetypes'),
+ $tdmcreate->getConfig('maxsize'), null, null);
+ if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) {
+ $uploader->fetchMedia($_POST['xoops_upload_file'][0]);
+ if (!$uploader->upload()) {
+ $errors = $uploader->getErrors();
+ redirect_header('javascript:history.go(-1)', 3, $errors);
+ } else {
+ $tablesObj->setVar('table_image', $uploader->getSavedFileName());
}
- redirect_header('tables.php?op=new', 3, sprintf(_AM_TDMCREATE_ERROR_TABLE_NAME_EXIST, $_POST['table_name']));
- } else {
- if (isset($tableId)) {
- $tablesObj =& $tables->get($tableId);
- } else {
- $tablesObj =& $tables->create();
- }
- $order = $tablesObj->isNew() ? $tableOrder + 1 : $tableOrder;
- // Form save tables
- $tablesObj->setVars(array('table_mid' => $tableMid,
- 'table_name' => $_POST['table_name'],
- 'table_category' => (($_REQUEST['table_category'] == 1) ? '1' : '0'),
- 'table_nbfields' => $tableNumbFields,
- 'table_order' => $order,
- 'table_fieldname' => $tableFieldname));
- //Form table_image
- include_once XOOPS_ROOT_PATH.'/class/uploader.php';
- $framePathIcon32 = XOOPS_ROOT_PATH . '/Frameworks/moduleclasses/icons/32';
- $uploaddir = is_dir($framePathIcon32) ? $framePathIcon32 : TDMC_UPLOAD_IMGTAB_PATH;
- $uploader = new XoopsMediaUploader($uploaddir, $tdmcreate->getConfig('mimetypes'),
- $tdmcreate->getConfig('maxsize'), null, null);
- if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) {
- $uploader->fetchMedia($_POST['xoops_upload_file'][0]);
- if (!$uploader->upload()) {
- $errors = $uploader->getErrors();
- redirect_header('javascript:history.go(-1)', 3, $errors);
- } else {
- $tablesObj->setVar('table_image', $uploader->getSavedFileName());
- }
+ } else {
+ $tablesObj->setVar('table_image', $_POST['table_image']);
+ }
+ $tablesObj->setVars(array('table_autoincrement' => $_REQUEST['table_autoincrement'],
+ 'table_blocks' => $_REQUEST['table_blocks'],
+ 'table_admin' => $_REQUEST['table_admin'],
+ 'table_user' => $_REQUEST['table_user'],
+ 'table_submenu' => $_REQUEST['table_submenu'],
+ 'table_submit' => $_REQUEST['table_submit'],
+ 'table_tag' => $_REQUEST['table_tag'],
+ 'table_broken' => $_REQUEST['table_broken'],
+ 'table_search' => $_REQUEST['table_search'],
+ 'table_comments' => $_REQUEST['table_comments'],
+ 'table_notifications' => $_REQUEST['table_notifications'],
+ 'table_permissions' => $_REQUEST['table_permissions'],
+ 'table_rate' => $_REQUEST['table_rate'],
+ 'table_print' => $_REQUEST['table_print'],
+ 'table_pdf' => $_REQUEST['table_pdf'],
+ 'table_rss' => $_REQUEST['table_rss'],
+ 'table_single' => $_REQUEST['table_single'],
+ 'table_visit' => $_REQUEST['table_visit']
+ ) );
+ //
+ if( $tables->insert($tablesObj) ) {
+ if( $tablesObj->isNew() ) {
+ $tableTid = $GLOBALS['xoopsDB']->getInsertId();
+ $tableAction = '&field_mid='.$tableMid.'&field_tid='.$tableTid.'&field_numb='.$tableNumbFields.'&field_name='.$tableFieldname;
+ redirect_header('fields.php?op=new'.$tableAction, 5, sprintf(_AM_TDMCREATE_TABLE_FORM_CREATED_OK, $_POST['table_name']));
} else {
- $tablesObj->setVar('table_image', $_POST['table_image']);
- }
- $tablesObj->setVars(array('table_autoincrement' => (($_REQUEST['table_autoincrement'] == 1) ? '1' : '0'),
- '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_submit' => (($_REQUEST['table_submit'] == 1) ? '1' : '0'),
- 'table_tag' => (($_REQUEST['table_tag'] == 1) ? '1' : '0'),
- 'table_broken' => (($_REQUEST['table_broken'] == 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_permissions' => (($_REQUEST['table_permissions'] == 1) ? '1' : '0'),
- 'table_rate' => (($_REQUEST['table_rate'] == 1) ? '1' : '0'),
- 'table_print' => (($_REQUEST['table_print'] == 1) ? '1' : '0'),
- 'table_pdf' => (($_REQUEST['table_pdf'] == 1) ? '1' : '0'),
- 'table_rss' => (($_REQUEST['table_rss'] == 1) ? '1' : '0'),
- 'table_single' => (($_REQUEST['table_single'] == 1) ? '1' : '0'),
- 'table_visit' => (($_REQUEST['table_visit'] == 1) ? '1' : '0')
- ) );
- //
- if( $tables->insert($tablesObj) ) {
- if( $tablesObj->isNew() ) {
- $tableTid = $GLOBALS['xoopsDB']->getInsertId();
- $table_action = '&field_mid='.$tableMid.'&field_tid='.$tableTid.'&field_numb='.$tableNumbFields.'&field_name='.$tableFieldname;
- redirect_header('fields.php?op=new'.$table_action, 5, sprintf(_AM_TDMCREATE_TABLE_FORM_CREATED_OK, $_POST['table_name']));
- } else {
- // Get fields where table id
- $fields =& $tdmcreate->getHandler('fields');
- $fieldsObj = $fields->get($tableId);
- $fieldsObj->setVar('field_numb', $tableNumbFields);
- $fields->insert($fieldsObj);
- redirect_header('tables.php', 5, sprintf(_AM_TDMCREATE_TABLE_FORM_UPDATED_OK, $_POST['table_name']));
- }
+ // Get fields where table id
+ $fields =& $tdmcreate->getHandler('fields');
+ $fieldsObj = $fields->get($tableId);
+ $fieldsObj->setVar('field_numb', $tableNumbFields);
+ $fields->insert($fieldsObj);
+ redirect_header('tables.php', 5, sprintf(_AM_TDMCREATE_TABLE_FORM_UPDATED_OK, $_POST['table_name']));
}
}
//
Deleted: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/about.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/about.php 2015-04-28 16:44:18 UTC (rev 13049)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/about.php 2015-04-28 21:55:41 UTC (rev 13050)
@@ -1,73 +0,0 @@
-<?php
-/*
- You may not change or alter any portion of this comment or credits
- of supporting developers from this source code or any supporting source code
- which is considered copyrighted (c) material of the original comment or credit authors.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- */
-/**
- * tdmcreate module
- *
- * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
- * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
- * @package tdmcreate
- * @since 2.5.0
- * @author Txmod Xoops http://www.txmodxoops.org
- * @version $Id: 1.91 admin_about.php 12258 2014-01-02 09:33:29Z timgno $
- */
-defined('XOOPS_ROOT_PATH') or die('Restricted access');
-
-class AdminAbout extends TDMCreateFile
-{
- /*
- * @public function constructor
- * @param null
- */
- public function __construct() {
- $this->tdmcfile = TDMCreateFile::getInstance();
- }
- /*
- * @static function &getInstance
- * @param null
- */
- public static function &getInstance()
- {
- static $instance = false;
- if (!$instance) {
- $instance = new self();
- }
- return $instance;
- }
- /*
- * @public function write
- * @param string $module
- * @param string $filename
- */
- public function write($module, $filename) {
- $this->setModule($module);
- $this->setFileName($filename);
- }
- /*
- * @public function render
- * @param null
- */
- public function render() {
- $module = $this->getModule();
- $filename = $this->getFileName();
- $moduleDirname = $module->getVar('mod_dirname');
- $moduleDonations = $module->getVar('mod_donations');
- $content = $this->getHeaderFilesComments($module, $filename);
- $content .= <<<EOT
-include 'header.php';
-\$template_main = '{$moduleDirname}_admin_about.tpl';
-\$GLOBALS['xoopsTpl']->assign('navigation', \$adminMenu->addNavigation('about.php'));
-\$GLOBALS['xoopsTpl']->assign('about', \$adminMenu->renderAbout('{$moduleDonations}', false));
-include 'footer.php';
-EOT;
- $this->tdmcfile->create($moduleDirname, 'admin', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
- return $this->tdmcfile->renderFile();
- }
-}
\ No newline at end of file
Deleted: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/footer.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/footer.php 2015-04-28 16:44:18 UTC (rev 13049)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/footer.php 2015-04-28 21:55:41 UTC (rev 13050)
@@ -1,73 +0,0 @@
-<?php
-/*
- You may not change or alter any portion of this comment or credits
- of supporting developers from this source code or any supporting source code
- which is considered copyrighted (c) material of the original comment or credit authors.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- */
-/**
- * tdmcreate module
- *
- * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
- * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
- * @package tdmcreate
- * @since 2.5.0
- * @author Txmod Xoops http://www.txmodxoops.org
- * @version $Id: 1.91 admin_footer.php 12258 2014-01-02 09:33:29Z timgno $
- */
-defined('XOOPS_ROOT_PATH') or die('Restricted access');
-
-class AdminFooter extends TDMCreateFile
-{
- /*
- * @public function constructor
- * @param null
- */
- public function __construct() {
- $this->tdmcfile = TDMCreateFile::getInstance();
- }
- /*
- * @static function &getInstance
- * @param string $module
- * @param string $filename
- */
- public static function &getInstance()
- {
- static $instance = false;
- if (!$instance) {
- $instance = new self();
- }
- return $instance;
- }
- /*
- * @public function write
- * @param string $module
- * @param string $filename
- */
- public function write($module, $filename) {
- $this->setModule($module);
- $this->setFileName($filename);
- }
- /*
- * @public function render
- * @param null
- */
- public function render() {
- $module = $this->getModule();
- $filename = $this->getFileName();
- $moduleDirname = $module->getVar('mod_dirname');
- $content = $this->getHeaderFilesComments($module, $filename);
- $content .= <<<EOT
-if ( isset(\$template_main) ) {
- \$GLOBALS['xoopsTpl']->display("db:{\$template_main}");
-}
-xoops_cp_footer();
-?>
-EOT;
- $this->tdmcfile->create($moduleDirname, 'admin', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
- return $this->tdmcfile->renderFile();
- }
-}
\ No newline at end of file
Deleted: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/header.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/header.php 2015-04-28 16:44:18 UTC (rev 13049)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/header.php 2015-04-28 21:55:41 UTC (rev 13050)
@@ -1,126 +0,0 @@
-<?php
-/*
- You may not change or alter any portion of this comment or credits
- of supporting developers from this source code or any supporting source code
- which is considered copyrighted (c) material of the original comment or credit authors.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- */
-/**
- * tdmcreate module
- *
- * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
- * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
- * @package tdmcreate
- * @since 2.5.0
- * @author Txmod Xoops http://www.txmodxoops.org
- * @version $Id: admin_header.php 12258 2014-01-02 09:33:29Z timgno $
- */
-defined('XOOPS_ROOT_PATH') or die('Restricted access');
-
-class AdminHeader extends TDMCreateFile
-{
- /*
- * @public function constructor
- * @param null
- */
- public function __construct() {
- $this->tdmcfile = TDMCreateFile::getInstance();
- }
- /*
- * @static function &getInstance
- * @param null
- */
- public static function &getInstance()
- {
- static $instance = false;
- if (!$instance) {
- $instance = new self();
- }
- return $instance;
- }
- /*
- * @public function write
- * @param string $module
- * @param mixed $table
- * @param array $tables
- * @param string $filename
- */
- public function write($module, $table, $tables, $filename) {
- $this->setModule($module);
- $this->setTable($table);
- $this->setTables($tables);
- $this->setFileName($filename);
- }
- /*
- * @public function render
- * @param null
- */
- public function render() {
- $module = $this->getModule();
- $table = $this->getTable();
- $tables = $this->getTables();
- $filename = $this->getFileName();
- $moduleDirname = $module->getVar('mod_dirname');
- $ucfModuleDirname = ucfirst($moduleDirname);
- $language = $this->getLanguage('AM');
- $content = $this->getHeaderFilesComments($module, $filename);
- $content .= <<<EOT
-\nrequire_once dirname(dirname(dirname(dirname(__FILE__)))). '/include/cp_header.php';
-\$thisPath = dirname(dirname(__FILE__));
-include_once \$thisPath.'/include/common.php';
-\$sysPathIcon16 = '../' . \$xoopsModule->getInfo('sysicons16');
-\$sysPathIcon32 = '../' . \$xoopsModule->getInfo('sysicons32');
-\$pathModuleAdmin = \$GLOBALS['xoopsModule']->getInfo('dirmoduleadmin');
-//
-\$modPathIcon16 = \$xoopsModule->getInfo('modicons16');
-\$modPathIcon32 = \$xoopsModule->getInfo('modicons32');\n
-EOT;
- if (is_object($table)) {
- if ( $table->getVar('table_name') != '' ) {
- $content .= <<<EOT
-// Get instance of module
-\${$moduleDirname} = {$ucfModuleDirname}Helper::getInstance();\n
-EOT;
- }
- foreach (array_keys($tables) as $t)
- {
- $tableName = $tables[$t]->getVar('table_name');
- $content .= <<<EOT
-// {$tableName}
-\${$tableName}Handler =& \${$moduleDirname}->getHandler('{$tableName}');\n
-EOT;
- }
- }
- $content .=<<<EOT
-//
-\$myts =& MyTextSanitizer::getInstance();
-if (!isset(\$xoopsTpl) || !is_object(\$xoopsTpl)) {
- include_once(XOOPS_ROOT_PATH."/class/template.php");
- \$xoopsTpl = new XoopsTpl();
-}
-// System icons path
-\$xoopsTpl->assign('sysPathIcon16', \$sysPathIcon16);
-\$xoopsTpl->assign('sysPathIcon32', \$sysPathIcon32);
-// Local icons path
-\$xoopsTpl->assign('modPathIcon16', \$modPathIcon16);
-\$xoopsTpl->assign('modPathIcon32', \$modPathIcon32);
-
-//Load languages
-xoops_loadLanguage('admin');
-xoops_loadLanguage('modinfo');
-// Local admin menu class
-if ( file_exists(\$GLOBALS['xoops']->path(\$pathModuleAdmin.'/moduleadmin.php'))){
- include_once \$GLOBALS['xoops']->path(\$pathModuleAdmin.'/moduleadmin.php');
-}else{
- redirect_header("../../../admin.php", 5, _AM_MODULEADMIN_MISSING, false);
-}
-xoops_cp_header();
-\$adminMenu = new ModuleAdmin();
-EOT;
- $this->tdmcfile->create($moduleDirname, 'admin', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
- return $this->tdmcfile->renderFile();
- }
-}
\ No newline at end of file
Deleted: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/index.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/index.php 2015-04-28 16:44:18 UTC (rev 13049)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/index.php 2015-04-28 21:55:41 UTC (rev 13050)
@@ -1,114 +0,0 @@
-<?php
-/*
- You may not change or alter any portion of this comment or credits
- of supporting developers from this source code or any supporting source code
- which is considered copyrighted (c) material of the original comment or credit authors.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- */
-/**
- * tdmcreate module
- *
- * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
- * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
- * @package tdmcreate
- * @since 2.5.0
- * @author Txmod Xoops http://www.txmodxoops.org
- * @version $Id: admin_index.php 12258 2014-01-02 09:33:29Z timgno $
- */
-defined('XOOPS_ROOT_PATH') or die('Restricted access');
-
-class AdminIndex extends TDMCreateFile
-{
- /*
- * @public function constructor
- * @param null
- */
- public function __construct() {
- $this->tdmcfile = TDMCreateFile::getInstance();
- }
- /*
- * @static function &getInstance
- * @param null
- */
- public static function &getInstance()
- {
- static $instance = false;
- if (!$instance) {
- $instance = new self();
- }
- return $instance;
- }
- /*
- * @public function write
- * @param string $module
- * @param mixed $tables
- * @param string $filename
- */
- public function write($module, $tables, $filename) {
- $this->setModule($module);
- $this->setTables($tables);
- $this->setFileName($filename);
- }
- /*
- * @public function render
- * @param null
- */
- public function render() {
- $module = $this->getModule();
- $tables = $this->getTables();
- $filename = $this->getFileName();
- $moduleDirname = $module->getVar('mod_dirname');
- $language = $this->getLanguage($moduleDirname, 'AM');
- $language_thereare = $this->getLanguage($moduleDirname, 'AM', 'THEREARE_');
- $content = $this->getHeaderFilesComments($module, $filename);
- $content .= <<<EOT
-include_once 'header.php';
-// Count elements\n
-EOT;
- $tableName = null;
- if(is_array($tables)) {
- foreach (array_keys($tables) as $i)
- {
- $tableName = $tables[$i]->getVar('table_name');
- $content .= <<<EOT
-\$count_{$tableName} = \${$tableName}Handler->getCount();\n
-EOT;
- }
- }
- $content .= <<<EOT
-// Template Index
-\$template_main = '{$moduleDirname}_admin_index.tpl';\n
-EOT;
- if(is_array($tables)) {
- $content .= <<<EOT
-// InfoBox Statistics
-\$adminMenu->addInfoBox({$language}STATISTICS);
-// Info elements\n
-EOT;
- foreach (array_keys($tables) as $i)
- {
- $tableName = $tables[$i]->getVar('table_name');
- $stuTableName = $language_thereare.strtoupper($tableName);
- $content .= <<<EOT
-\$adminMenu->addInfoBoxLine({$language}STATISTICS, '<label>'.{$stuTableName}.'</label>', \$count_{$tableName});\n
-EOT;
- }
- }
- if($tableName == null) {
- $content .= <<<EOT
-\$adminMenu->addInfoBoxLine({$language}STATISTICS, '<label>No statistics</label>', 0);\n
-EOT;
- }
- $content .= <<<EOT
-// Render Index
-echo \$adminMenu->addNavigation('index.php');
-echo \$adminMenu->renderIndex();
-include_once 'footer.php';
-EOT;
- $this->tdmcfile->create($moduleDirname, 'admin', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
- return $this->tdmcfile->renderFile();
- }
-}
\ No newline at end of file
Deleted: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/menu.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/menu.php 2015-04-28 16:44:18 UTC (rev 13049)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/menu.php 2015-04-28 21:55:41 UTC (rev 13050)
@@ -1,165 +0,0 @@
-<?php
-/*
- You may not change or alter any portion of this comment or credits
- of supporting developers from this source code or any supporting source code
- which is considered copyrighted (c) material of the original comment or credit authors.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- */
-/**
- * tdmcreate module
- *
- * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
- * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
- * @package tdmcreate
- * @since 2.5.0
- * @author Txmod Xoops http://www.txmodxoops.org
- * @version $Id: admin_menu.php 12258 2014-01-02 09:33:29Z timgno $
- */
-defined('XOOPS_ROOT_PATH') or die('Restricted access');
-
-class AdminMenu extends TDMCreateFile
-{
- /*
- * @public function constructor
- * @param null
- */
- public function __construct() {
- parent::__construct();
- $this->tdmcfile = TDMCreateFile::getInstance();
- }
- /*
- * @static function &getInstance
- * @param null
- */
- public static function &getInstance()
- {
- static $instance = false;
- if (!$instance) {
- $instance = new self();
- }
- return $instance;
- }
- /*
- * @public function write
- * @param string $module
- * @param object $table
- * @param array $tables
- * @param string $filename
- */
- public function write($module, $table, $tables, $filename) {
- $this->setModule($module);
- $this->setTable($table);
- $this->setTables($tables);
- $this->setFileName($filename);
- }
- /*
- * @private function getAdminMenuHeader
- * @param null
- */
- private function getAdminMenuHeader() {
- $ret = <<<EOT
-\$dirname = basename( dirname( dirname( __FILE__ ) ) ) ;
-\$module_handler =& xoops_gethandler('module');
-\$xoopsModule =& XoopsModule::getByDirname(\$dirname);
-\$moduleInfo =& \$module_handler->get(\$xoopsModule->getVar('mid'));
-\$sysPathIcon32 = \$moduleInfo->getInfo('sysicons32');\n
-EOT;
- return $ret;
- }
- /*
- * @private function getAdminMenuDashboard
- * @param string $language
- * @param integer $menu
- */
- private function getAdminMenuDashboard($language, $menu) {
- $ret = <<<EOT
-\$i = 1;
-\$adminmenu[\$i]['title'] = {$language}{$menu};
-\$adminmenu[\$i]['link'] = 'admin/index.php';
-\$adminmenu[\$i]['icon'] = \$sysPathIcon32.'/dashboard.png';
-\$i++;\n
-EOT;
- return $ret;
- }
- /*
- * @private function getAdminMenuImagesPath
- * @param array $tables
- * @param integer $t
- */
- private function getAdminMenuImagesPath($tables, $t) {
- $fields = $this->getTableFields($tables[$t]->getVar('table_id'));
- foreach (array_keys($fields) as $f)
- {
- $fieldElement = $fields[$f]->getVar('field_element');
- switch( $fieldElement ) {
- case 11:
- $ret = <<<EOT
-\$adminmenu[\$i]['icon'] = 'assets/icons/32/{$tables[$t]->getVar('table_image')}';\n
-EOT;
- break;
- default:
- $ret = <<<EOT
-\$adminmenu[\$i]['icon'] = \$sysPathIcon32.'/{$tables[$t]->getVar('table_image')}';\n
-EOT;
- break;
- }
- }
- return $ret;
- }
- /*
- * @public function render
- * @param null
- */
- public function render() {
- $module = $this->getModule();
- $table = $this->getTable();
- $tables = $this->getTables();
- $filename = $this->getFileName();
- $moduleDirname = $module->getVar('mod_dirname');
- $language = $this->getLanguage($moduleDirname, 'MI', 'ADMENU');
- $menu = 1;
- $content = $this->getHeaderFilesComments($module, $filename);
- $content .= $this->getAdminMenuHeader();
- $content .= $this->getAdminMenuDashboard($language, $menu);
- foreach (array_keys($tables) as $t)
- {
- $tablePermissions = $tables[$t]->getVar('table_permissions');
- if ( $tables[$t]->getVar('table_admin') == 1 )
- {
- $menu++;
- $content .= <<<EOT
-\$adminmenu[\$i]['title'] = {$language}{$menu};
-\$adminmenu[\$i]['link'] = 'admin/{$tables[$t]->getVar('table_name')}.php';
-\$adminmenu[\$i]['icon'] = 'assets/icons/32/{$tables[$t]->getVar('table_image')}';\n
-EOT;
- //$content .= $this->getAdminMenuImagesPath($tables, $t);
- $content .= <<<EOT
-\$i++;\n
-EOT;
- }
- }
- if (is_object($table) && $table->getVar('table_permissions') == 1) {
- $menu++;
- $content .= <<<EOT
-\$adminmenu[\$i]['title'] = {$language}{$menu};
-\$adminmenu[\$i]['link'] = 'admin/permissions.php';
-\$adminmenu[\$i]['icon'] = \$sysPathIcon32.'/permissions.png';
-\$i++;\n
-EOT;
- }
- $menu++;
- $content .= <<<EOT
-\$adminmenu[\$i]['title'] = {$language}{$menu};
-\$adminmenu[\$i]['link'] = 'admin/about.php';
-\$adminmenu[\$i]['icon'] = \$sysPathIcon32.'/about.png';
-unset( \$i );
-EOT;
- unset( $menu );
-
- $this->tdmcfile->create($moduleDirname, 'admin', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
- return $this->tdmcfile->renderFile();
- }
-}
\ No newline at end of file
Deleted: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/objects.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/objects.php 2015-04-28 16:44:18 UTC (rev 13049)
+++ XoopsModules/TDMCreate/branc...
[truncated message content] |
|
From: <txm...@us...> - 2015-05-01 16:05:59
|
Revision: 13051
http://sourceforge.net/p/xoops/svn/13051
Author: txmodxoops
Date: 2015-05-01 16:05:55 +0000 (Fri, 01 May 2015)
Log Message:
-----------
Updated
Fixed bugs
Database new use Engine=InnoDB
Deleted field_numb: This field can be called from the table_nbfield in tables
Modified includes with __DIR__
Needed a fresh installation
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/about.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/building.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/footer.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/header.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/index.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/menu.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/modules.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/css/admin/style.css
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/js/sortable.js
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/TDMCreateAutoload.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/TDMCreateHelper.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/TDMCreateSession.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/building.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/fieldattributes.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/fieldelements.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/fieldkey.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/fieldnull.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/fieldtype.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateAbstract.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateArchitecture.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateFile.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateHtmlSmartyCodes.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateStructure.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateTableFields.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminAbout.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminFooter.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminHeader.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminIndex.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminMenu.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminObjects.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminPages.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminPermissions.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/blocks/BlocksFiles.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/classes/ClassFiles.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/classes/ClassFormElements.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/classes/ClassHelper.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/css/CssStyles.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/docs/DocsChangelog.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/docs/DocsFiles.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/include/IncludeCommentFunctions.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/include/IncludeComments.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/include/IncludeCommon.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/include/IncludeFunctions.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/include/IncludeInstall.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/include/IncludeJquery.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/include/IncludeNotifications.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/include/IncludeSearch.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/include/IncludeUpdate.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/language/LanguageAdmin.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/language/LanguageBlocks.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/language/LanguageDefines.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/language/LanguageHelp.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/language/LanguageMailTpl.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/language/LanguageMain.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/language/LanguageModinfo.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/sql/SqlFile.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/templates/TDMCreateHtmlSmartyCodes.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/templates/admin/TemplatesAdminAbout.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/templates/admin/TemplatesAdminFooter.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/templates/admin/TemplatesAdminHeader.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/templates/admin/TemplatesAdminIndex.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/templates/admin/TemplatesAdminPages.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/templates/admin/TemplatesAdminPermissions.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/templates/blocks/TemplatesBlocks.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/templates/user/TemplatesUserFooter.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/templates/user/TemplatesUserHeader.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/templates/user/TemplatesUserIndex.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/templates/user/TemplatesUserPages.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/user/UserFooter.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/user/UserHeader.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/user/UserIndex.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/user/UserNotificationUpdate.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/user/UserObjects.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/user/UserPages.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/user/UserPrint.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/user/UserRss.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/user/UserSubmit.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/user/UserXoopsVersion.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/form/TDMCreateFormRadio.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/form/TDMCreateThemeForm.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/html/TDMCreateFormLabel.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/logoGenerator.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/modules.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/include/common.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/include/functions.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/language/english/admin.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/language/english/modinfo.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/sql/mysql.sql
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/templates/admin/tdmcreate_fields.tpl
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/templates/admin/tdmcreate_fields_item.tpl
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/templates/admin/tdmcreate_modules.tpl
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/templates/admin/tdmcreate_tables.tpl
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/templates/admin/tdmcreate_tables_item.tpl
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/xoops_version.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/about.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/about.php 2015-04-28 21:55:41 UTC (rev 13050)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/about.php 2015-05-01 16:05:55 UTC (rev 13051)
@@ -18,8 +18,8 @@
* @author Txmod Xoops http://www.txmodxoops.org
* @version $Id: about.php 11084 2013-02-23 15:44:20Z timgno $
*/
-include 'header.php';
-$template_main = 'tdmcreate_about.tpl';
+include __DIR__ . '/header.php';
+$template_main = 'tdmcreate_about.tpl';
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('about.php'));
$GLOBALS['xoopsTpl']->assign('about', $adminMenu->renderAbout('6KJ7RW5DR3VTJ', false));
-include 'footer.php';
\ No newline at end of file
+include __DIR__ . '/footer.php';
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/building.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/building.php 2015-04-28 21:55:41 UTC (rev 13050)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/building.php 2015-05-01 16:05:55 UTC (rev 13051)
@@ -18,78 +18,72 @@
* @author Txmod Xoops http://www.txmodxoops.org
* @version $Id: building.php 12258 2014-01-02 09:33:29Z timgno $
*/
-include __DIR__ . DIRECTORY_SEPARATOR . 'header.php';
-$op = XoopsRequest::getString('op', 'default');
-$mid = XoopsRequest::getInt('mod_id');
-$moduleObj = $tdmcreate->getHandler('modules')->get( $mid );
+include __DIR__ . '/header.php';
+$op = XoopsRequest::getString('op', 'default');
+$mid = XoopsRequest::getInt('mod_id');
+$moduleObj = $tdmcreate->getHandler('modules')->get($mid);
// Switch option
switch ($op) {
- case 'build':
- $template_main = 'tdmcreate_building.tpl';
- $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('building.php'));
- // Get var module dirname
- $moduleDirname = $moduleObj->getVar('mod_dirname');
- // Directories for copy from to
- $fromDir = TDMC_UPLOAD_REPOSITORY_PATH.'/'.strtolower($moduleDirname);
- $toDir = XOOPS_ROOT_PATH.'/modules/'.strtolower($moduleDirname);
- if(isset($moduleDirname)) {
- // Clear this module if it's in repository
- if(is_dir($fromDir)) {
- TDMCreate_clearDir($fromDir);
- }
- // Clear this module if it's in root/modules
- if(is_dir($toDir)) {
- TDMCreate_clearDir($toDir);
- }
- }
- // Structure
- include_once TDMC_PATH . '/class/files/TDMCreateArchitecture.php';
- $handler = TDMCreateArchitecture::getInstance();
- // Creation of the structure of folders and files
- $base_architecture = $handler->createBaseFoldersFiles( $moduleObj );
- if(false !== $base_architecture) {
- $GLOBALS['xoopsTpl']->assign('base_architecture', true);
- } else {
- $GLOBALS['xoopsTpl']->assign('base_architecture', false);
- }
- // Get files
- $build = array();
- $files = $handler->createFilesToBuilding( $moduleObj );
- foreach($files as $file) {
- if($file) {
- $build['list'] = $file;
- }
- $GLOBALS['xoopsTpl']->append('builds', $build);
- }
- unset($build);
- // Directory to saved all files
- $GLOBALS['xoopsTpl']->assign('building_directory', sprintf(_AM_TDMCREATE_BUILDING_DIRECTORY, $moduleDirname));
- // Copy this module in root modules
- if( $moduleObj->getVar('mod_inroot_copy') == 1 ) {
- TDMCreate_copyr($fromDir, $toDir);
+ case 'build':
+ $template_main = 'tdmcreate_building.tpl';
+ $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('building.php'));
+ // Get var module dirname
+ $moduleDirname = $moduleObj->getVar('mod_dirname');
+ // Directories for copy from to
+ $fromDir = TDMC_UPLOAD_REPOSITORY_PATH . '/' . strtolower($moduleDirname);
+ $toDir = XOOPS_ROOT_PATH . '/modules/' . strtolower($moduleDirname);
+ if (isset($moduleDirname)) {
+ // Clear this module if it's in repository
+ if (is_dir($fromDir)) {
+ TDMCreate_clearDir($fromDir);
+ }
+ // Clear this module if it's in root/modules
+ if (is_dir($toDir)) {
+ TDMCreate_clearDir($toDir);
+ }
}
- break;
-
- case 'default':
- default:
- $template_main = 'tdmcreate_building.tpl';
- $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('building.php'));
- // Redirect if there aren't modules
- $nbModules = $tdmcreate->getHandler('modules')->getCount();
- if( $nbModules == 0 ) {
- redirect_header('modules.php?op=new', 2, _AM_TDMCREATE_NOTMODULES );
- }
- unset($nbModules);
- // Redirect if there aren't tables
- /*$nbTables = $tdmcreate->getHandler('tables')->getCount();
- if($nbTables == 0) {
- redirect_header('tables.php?op=new', 2, _AM_TDMCREATE_NOTTABLES );
- }
- unset($nbTables);*/
- include_once TDMC_PATH . '/class/building.php';
- $handler = TDMCreateBuilding::getInstance();
- $form = $handler->getForm();
- $GLOBALS['xoopsTpl']->assign('form', $form->render());
- break;
+ // Structure
+ include_once TDMC_PATH . '/class/files/TDMCreateArchitecture.php';
+ $handler = TDMCreateArchitecture::getInstance();
+ // Creation of the structure of folders and files
+ $base_architecture = $handler->createBaseFoldersFiles($moduleObj);
+ if (false !== $base_architecture) {
+ $GLOBALS['xoopsTpl']->assign('base_architecture', true);
+ } else {
+ $GLOBALS['xoopsTpl']->assign('base_architecture', false);
+ }
+ // Get files
+ $build = array();
+ $files = $handler->createFilesToBuilding($moduleObj);
+ foreach ($files as $file) {
+ if ($file) {
+ $build['list'] = $file;
+ }
+ $GLOBALS['xoopsTpl']->append('builds', $build);
+ }
+ unset($build);
+ // Directory to saved all files
+ $GLOBALS['xoopsTpl']->assign('building_directory', sprintf(_AM_TDMCREATE_BUILDING_DIRECTORY, $moduleDirname));
+ // Copy this module in root modules
+ if (1 == $moduleObj->getVar('mod_inroot_copy')) {
+ TDMCreate_copyr($fromDir, $toDir);
+ }
+ break;
+
+ case 'default':
+ default:
+ $template_main = 'tdmcreate_building.tpl';
+ $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('building.php'));
+ // Redirect if there aren't modules
+ $nbModules = $tdmcreate->getHandler('modules')->getCount();
+ if (0 == $nbModules) {
+ redirect_header('modules.php?op=new', 2, _AM_TDMCREATE_NOTMODULES);
+ }
+ unset($nbModules);
+ include_once TDMC_PATH . '/class/building.php';
+ $handler = TDMCreateBuilding::getInstance();
+ $form = $handler->getForm();
+ $GLOBALS['xoopsTpl']->assign('form', $form->render());
+ break;
}
-include __DIR__ . DIRECTORY_SEPARATOR . 'footer.php';
\ No newline at end of file
+include __DIR__ . '/footer.php';
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/fields.php 2015-04-28 21:55:41 UTC (rev 13050)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/fields.php 2015-05-01 16:05:55 UTC (rev 13051)
@@ -1,4 +1,4 @@
-<?php
+<?php
/*
You may not change or alter any portion of this comment or credits
of supporting developers from this source code or any supporting source code
@@ -18,289 +18,277 @@
* @author Txmod Xoops http://www.txmodxoops.org
* @version $Id: 1.91 fields.php 12258 2014-01-02 09:33:29Z timgno $
*/
-include __DIR__ . DIRECTORY_SEPARATOR . 'header.php';
+include __DIR__ . '/header.php';
// Recovered value of arguments op in the URL $
$op = XoopsRequest::getString('op', 'list');
// Get fields Variables
-$fieldMid = XoopsRequest::getInt('field_mid');
-$fieldTid = XoopsRequest::getInt('field_tid');
-$fieldNumb = XoopsRequest::getInt('field_numb');
+$fieldMid = XoopsRequest::getInt('field_mid');
+$fieldTid = XoopsRequest::getInt('field_tid');
+$fieldNumb = XoopsRequest::getInt('field_numb');
$fieldOrder = XoopsRequest::getInt('field_order');
-$fieldName = XoopsRequest::getString('field_name', '');
+$fieldName = XoopsRequest::getString('field_name', '');
// switch op
-switch ($op)
-{
- case 'list':
+switch ($op) {
+ case 'list':
default:
$start = XoopsRequest::getInt('start', 0);
- $limit = XoopsRequest::getInt('limit', $tdmcreate->getConfig('tables_adminpager'));
- // Define main template
- $template_main = 'tdmcreate_fields.tpl';
- $GLOBALS['xoTheme']->addStylesheet( 'modules/tdmcreate/assets/css/admin/style.css' );
- $GLOBALS['xoTheme']->addScript('modules/tdmcreate/assets/js/functions.js');
- $GLOBALS['xoTheme']->addScript('modules/tdmcreate/assets/js/sortable.js');
- $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('fields.php'));
- $adminMenu->addItemButton(_AM_TDMCREATE_ADD_TABLE, 'tables.php?op=new', 'add');
- $GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
- $GLOBALS['xoopsTpl']->assign('tdmc_url', TDMC_URL);
- $GLOBALS['xoopsTpl']->assign('tdmc_icons_url', TDMC_ICONS_URL);
- $GLOBALS['xoopsTpl']->assign('tdmc_upload_url', TDMC_UPLOAD_URL);
- $GLOBALS['xoopsTpl']->assign('tdmc_upload_imgtab_url', TDMC_UPLOAD_IMGTAB_URL);
- $GLOBALS['xoopsTpl']->assign('modPathIcon16', $modPathIcon16);
- $GLOBALS['xoopsTpl']->assign('sysPathIcon32', $sysPathIcon32);
- // Redirect if there aren't modules
- $countModules = $tdmcreate->getHandler('modules')->getCount();
- if ( $countModules == 0 ) {
- redirect_header('modules.php?op=new', 2, _AM_TDMCREATE_NOTMODULES );
- }
- unset($countModules);
- // Redirect if there aren't tables
- $handlerTables = $tdmcreate->getHandler('tables');
- $countTables = $handlerTables->getCount();
- if ($countTables == 0) {
- redirect_header('tables.php?op=new', 2, _AM_TDMCREATE_NOTTABLES );
- }
- unset($countTables);
- // Get the list of tables
- $criteria = new CriteriaCompo();
- $criteria->add(new Criteria('table_mid', $handlerTables->getVar('table_mid')));
- $criteria->setStart($start);
+ $limit = XoopsRequest::getInt('limit', $tdmcreate->getConfig('tables_adminpager'));
+ // Define main template
+ $template_main = 'tdmcreate_fields.tpl';
+ $GLOBALS['xoTheme']->addStylesheet('modules/tdmcreate/assets/css/admin/style.css');
+ $GLOBALS['xoTheme']->addScript('modules/tdmcreate/assets/js/functions.js');
+ $GLOBALS['xoTheme']->addScript('modules/tdmcreate/assets/js/sortable.js');
+ $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('fields.php'));
+ $adminMenu->addItemButton(_AM_TDMCREATE_ADD_TABLE, 'tables.php?op=new', 'add');
+ $GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
+ $GLOBALS['xoopsTpl']->assign('tdmc_url', TDMC_URL);
+ $GLOBALS['xoopsTpl']->assign('tdmc_icons_url', TDMC_ICONS_URL);
+ $GLOBALS['xoopsTpl']->assign('tdmc_upload_url', TDMC_UPLOAD_URL);
+ $GLOBALS['xoopsTpl']->assign('tdmc_upload_imgtab_url', TDMC_UPLOAD_IMGTAB_URL);
+ $GLOBALS['xoopsTpl']->assign('modPathIcon16', $modPathIcon16);
+ $GLOBALS['xoopsTpl']->assign('sysPathIcon32', $sysPathIcon32);
+ // Redirect if there aren't modules
+ $countModules = $tdmcreate->getHandler('modules')->getCount();
+ if (0 == $countModules) {
+ redirect_header('modules.php?op=new', 2, _AM_TDMCREATE_NOTMODULES);
+ }
+ unset($countModules);
+ // Redirect if there aren't tables
+ $handlerTables = $tdmcreate->getHandler('tables');
+ $countTables = $handlerTables->getCount();
+ if (0 == $countTables) {
+ redirect_header('tables.php?op=new', 2, _AM_TDMCREATE_NOTTABLES);
+ }
+ unset($countTables);
+ // Get the list of tables
+ $criteria = new CriteriaCompo();
+ $criteria->add(new Criteria('table_mid', $handlerTables->getVar('table_mid')));
+ $criteria->setStart($start);
$criteria->setLimit($limit);
- $criteria->setSort('table_id ASC, table_order ASC, table_name');
- $criteria->setOrder('ASC');
- $countTables = $tdmcreate->getHandler('tables')->getCount($criteria);
- $tablesAll = $tdmcreate->getHandler('tables')->getAll($criteria);
- unset($criteria);
- if ($countTables > 0)
- {
- $tlid = 1;
- foreach (array_keys($tablesAll) as $tid)
- {
- // Display tables list
- $table['id'] = $tid;
- $table['lid'] = $tlid;
- $table['mid'] = $tablesAll[$tid]->getVar('table_mid');
- $table['name'] = ucfirst($tablesAll[$tid]->getVar('table_name'));
- $table['image'] = $tablesAll[$tid]->getVar('table_image');
- $table['nbfields'] = $tablesAll[$tid]->getVar('table_nbfields');
- $table['order'] = $tablesAll[$tid]->getVar('table_order');
- $table['autoincrement'] = $tablesAll[$tid]->getVar('table_autoincrement');
- $table['blocks'] = $tablesAll[$tid]->getVar('table_blocks');
- $table['admin'] = $tablesAll[$tid]->getVar('table_admin');
- $table['user'] = $tablesAll[$tid]->getVar('table_user');
- $table['search'] = $tablesAll[$tid]->getVar('table_search');
+ $criteria->setSort('table_id ASC, table_order ASC, table_name');
+ $criteria->setOrder('ASC');
+ $countTables = $tdmcreate->getHandler('tables')->getCount($criteria);
+ $tablesAll = $tdmcreate->getHandler('tables')->getAll($criteria);
+ unset($criteria);
+ if ($countTables > 0) {
+ $tlid = 1;
+ foreach (array_keys($tablesAll) as $tid) {
+ // Display tables list
+ $table['id'] = $tid;
+ $table['lid'] = $tlid;
+ $table['mid'] = $tablesAll[$tid]->getVar('table_mid');
+ $table['name'] = ucfirst($tablesAll[$tid]->getVar('table_name'));
+ $table['image'] = $tablesAll[$tid]->getVar('table_image');
+ $table['nbfields'] = $tablesAll[$tid]->getVar('table_nbfields');
+ $table['order'] = $tablesAll[$tid]->getVar('table_order');
+ $table['autoincrement'] = $tablesAll[$tid]->getVar('table_autoincrement');
+ $table['blocks'] = $tablesAll[$tid]->getVar('table_blocks');
+ $table['admin'] = $tablesAll[$tid]->getVar('table_admin');
+ $table['user'] = $tablesAll[$tid]->getVar('table_user');
+ $table['search'] = $tablesAll[$tid]->getVar('table_search');
// Get the list of fields
- $criteria = new CriteriaCompo();
- $criteria->add(new Criteria('field_mid', $table['mid']));
- $criteria->add(new Criteria('field_tid', $tid));
- $criteria->setSort('field_order ASC, field_id ASC, field_name');
- $criteria->setOrder('ASC');
- $countFields = $tdmcreate->getHandler('fields')->getCount($criteria);
- $fieldsAll = $tdmcreate->getHandler('fields')->getObjects($criteria);
- unset($criteria);
- // Display fields list
- $fields = array();
- $lid = 1;
- if ( $countFields > 0 )
- {
- foreach (array_keys($fieldsAll) as $fid)
- {
- $field['id'] = $fid;
- $field['lid'] = $lid;
- $field['order'] = $fieldsAll[$fid]->getVar('field_order');
- $field['name'] = str_replace('_', ' ', ucfirst($fieldsAll[$fid]->getVar('field_name')));
- $field['parent'] = $fieldsAll[$fid]->getVar('field_parent');
- $field['inlist'] = $fieldsAll[$fid]->getVar('field_inlist');
- $field['inform'] = $fieldsAll[$fid]->getVar('field_inform');
- $field['admin'] = $fieldsAll[$fid]->getVar('field_admin');
- $field['user'] = $fieldsAll[$fid]->getVar('field_user');
- $field['block'] = $fieldsAll[$fid]->getVar('field_block');
- $field['main'] = $fieldsAll[$fid]->getVar('field_main');
- $field['search'] = $fieldsAll[$fid]->getVar('field_search');
- $field['required'] = $fieldsAll[$fid]->getVar('field_required');
- $fields[] = $field;
- unset($field);
- $lid++;
- }
- }
- $tlid++;
- unset($lid);
- $table['fields'] = $fields;
- $GLOBALS['xoopsTpl']->append('tables_list', $table);
- unset($table);
- }
- unset($tlid);
- unset($fields);
- if ( $countTables > $limit ) {
- include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
- $pagenav = new XoopsPageNav($countTables, $limit, $start, 'start', 'op=list&limit=' . $limit);
- $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4));
- }
- } else {
- $GLOBALS['xoopsTpl']->assign('error', _AM_TDMCREATE_THEREARENT_FIELDS);
- }
- break;
-
- case 'new':
- // Define main template
- $template_main = 'tdmcreate_fields.tpl';
- $GLOBALS['xoTheme']->addStylesheet( 'modules/tdmcreate/assets/css/admin/style.css' );
- $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('fields.php'));
- $adminMenu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php', 'list');
- $adminMenu->addItemButton(_AM_TDMCREATE_FIELDS_LIST, 'fields.php', 'list');
- $GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
- // Form Add
- $fieldsObj =& $tdmcreate->getHandler('fields')->create();
- $form = $fieldsObj->getFormNew($fieldMid, $fieldTid, $fieldNumb, $fieldName);
- $GLOBALS['xoopsTpl']->assign('form', $form->render());
- break;
-
- case 'save':
+ $criteria = new CriteriaCompo();
+ $criteria->add(new Criteria('field_mid', $table['mid']));
+ $criteria->add(new Criteria('field_tid', $tid));
+ $criteria->setSort('field_order ASC, field_id ASC, field_name');
+ $criteria->setOrder('ASC');
+ $countFields = $tdmcreate->getHandler('fields')->getCount($criteria);
+ $fieldsAll = $tdmcreate->getHandler('fields')->getObjects($criteria);
+ unset($criteria);
+ // Display fields list
+ $fields = array();
+ $lid = 1;
+ if ($countFields > 0) {
+ foreach (array_keys($fieldsAll) as $fid) {
+ $field['id'] = $fid;
+ $field['lid'] = $lid;
+ $field['order'] = $fieldsAll[$fid]->getVar('field_order');
+ $field['name'] = str_replace('_', ' ', ucfirst($fieldsAll[$fid]->getVar('field_name')));
+ $field['parent'] = $fieldsAll[$fid]->getVar('field_parent');
+ $field['inlist'] = $fieldsAll[$fid]->getVar('field_inlist');
+ $field['inform'] = $fieldsAll[$fid]->getVar('field_inform');
+ $field['admin'] = $fieldsAll[$fid]->getVar('field_admin');
+ $field['user'] = $fieldsAll[$fid]->getVar('field_user');
+ $field['block'] = $fieldsAll[$fid]->getVar('field_block');
+ $field['main'] = $fieldsAll[$fid]->getVar('field_main');
+ $field['search'] = $fieldsAll[$fid]->getVar('field_search');
+ $field['required'] = $fieldsAll[$fid]->getVar('field_required');
+ $fields[] = $field;
+ unset($field);
+ ++$lid;
+ }
+ }
+ ++$tlid;
+ unset($lid);
+ $table['fields'] = $fields;
+ $GLOBALS['xoopsTpl']->append('tables_list', $table);
+ unset($table);
+ }
+ unset($tlid, $fields);
+ if ($countTables > $limit) {
+ include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
+ $pagenav = new XoopsPageNav($countTables, $limit, $start, 'start', 'op=list&limit=' . $limit);
+ $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4));
+ }
+ } else {
+ $GLOBALS['xoopsTpl']->assign('error', _AM_TDMCREATE_THEREARENT_FIELDS);
+ }
+ break;
+
+ case 'new':
+ // Define main template
+ $template_main = 'tdmcreate_field...
[truncated message content] |
|
From: <txm...@us...> - 2015-05-02 13:42:48
|
Revision: 13052
http://sourceforge.net/p/xoops/svn/13052
Author: txmodxoops
Date: 2015-05-02 13:42:44 +0000 (Sat, 02 May 2015)
Log Message:
-----------
Updated
Fixed minor bugs
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/css/admin/style.css
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminObjects.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminPages.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminPermissions.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/classes/ClassFiles.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/language/LanguageAdmin.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/language/LanguageDefines.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/sql/SqlFile.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/templates/admin/TemplatesAdminPages.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/user/UserIndex.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/user/UserObjects.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/user/UserPrint.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/user/UserRss.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/include/install.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/sql/mysql.sql
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/templates/admin/tdmcreate_fields_item.tpl
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/templates/admin/tdmcreate_tables.tpl
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/templates/admin/tdmcreate_tables_item.tpl
Added Paths:
-----------
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/SplClassLoader.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/language/english/mail_template/
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/language/english/mail_template/index.html
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/fields.php 2015-05-01 16:05:55 UTC (rev 13051)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/fields.php 2015-05-02 13:42:44 UTC (rev 13052)
@@ -1,4 +1,4 @@
-<?php
+<?php
/*
You may not change or alter any portion of this comment or credits
of supporting developers from this source code or any supporting source code
@@ -18,277 +18,284 @@
* @author Txmod Xoops http://www.txmodxoops.org
* @version $Id: 1.91 fields.php 12258 2014-01-02 09:33:29Z timgno $
*/
-include __DIR__ . '/header.php';
+include __DIR__ . '/header.php';
// Recovered value of arguments op in the URL $
$op = XoopsRequest::getString('op', 'list');
// Get fields Variables
-$fieldMid = XoopsRequest::getInt('field_mid');
-$fieldTid = XoopsRequest::getInt('field_tid');
-$fieldNumb = XoopsRequest::getInt('field_numb');
-$fieldOrder = XoopsRequest::getInt('field_order');
-$fieldName = XoopsRequest::getString('field_name', '');
+$fieldMid = XoopsRequest::getInt('field_mid');
+$fieldTid = XoopsRequest::getInt('field_tid');
+$fieldNumb = XoopsRequest::getInt('field_numb');
+$fieldName = XoopsRequest::getString('field_name', '');
// switch op
-switch ($op) {
- case 'list':
+switch ($op)
+{
+ case 'list':
default:
$start = XoopsRequest::getInt('start', 0);
- $limit = XoopsRequest::getInt('limit', $tdmcreate->getConfig('tables_adminpager'));
- // Define main template
- $template_main = 'tdmcreate_fields.tpl';
- $GLOBALS['xoTheme']->addStylesheet('modules/tdmcreate/assets/css/admin/style.css');
- $GLOBALS['xoTheme']->addScript('modules/tdmcreate/assets/js/functions.js');
- $GLOBALS['xoTheme']->addScript('modules/tdmcreate/assets/js/sortable.js');
- $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('fields.php'));
- $adminMenu->addItemButton(_AM_TDMCREATE_ADD_TABLE, 'tables.php?op=new', 'add');
- $GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
- $GLOBALS['xoopsTpl']->assign('tdmc_url', TDMC_URL);
- $GLOBALS['xoopsTpl']->assign('tdmc_icons_url', TDMC_ICONS_URL);
- $GLOBALS['xoopsTpl']->assign('tdmc_upload_url', TDMC_UPLOAD_URL);
- $GLOBALS['xoopsTpl']->assign('tdmc_upload_imgtab_url', TDMC_UPLOAD_IMGTAB_URL);
- $GLOBALS['xoopsTpl']->assign('modPathIcon16', $modPathIcon16);
- $GLOBALS['xoopsTpl']->assign('sysPathIcon32', $sysPathIcon32);
- // Redirect if there aren't modules
- $countModules = $tdmcreate->getHandler('modules')->getCount();
- if (0 == $countModules) {
- redirect_header('modules.php?op=new', 2, _AM_TDMCREATE_NOTMODULES);
- }
- unset($countModules);
- // Redirect if there aren't tables
- $handlerTables = $tdmcreate->getHandler('tables');
- $countTables = $handlerTables->getCount();
- if (0 == $countTables) {
- redirect_header('tables.php?op=new', 2, _AM_TDMCREATE_NOTTABLES);
- }
- unset($countTables);
- // Get the list of tables
- $criteria = new CriteriaCompo();
- $criteria->add(new Criteria('table_mid', $handlerTables->getVar('table_mid')));
- $criteria->setStart($start);
+ $limit = XoopsRequest::getInt('limit', $tdmcreate->getConfig('tables_adminpager'));
+ // Define main template
+ $template_main = 'tdmcreate_fields.tpl';
+ $GLOBALS['xoTheme']->addStylesheet( 'modules/tdmcreate/assets/css/admin/style.css' );
+ $GLOBALS['xoTheme']->addScript('browse.php?Frameworks/jquery/plugins/jquery.ui.js');
+ $GLOBALS['xoTheme']->addScript('modules/tdmcreate/assets/js/functions.js');
+ $GLOBALS['xoTheme']->addScript('modules/tdmcreate/assets/js/sortable.js');
+ $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('fields.php'));
+ $adminMenu->addItemButton(_AM_TDMCREATE_ADD_TABLE, 'tables.php?op=new', 'add');
+ $GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
+ $GLOBALS['xoopsTpl']->assign('tdmc_url', TDMC_URL);
+ $GLOBALS['xoopsTpl']->assign('tdmc_icons_url', TDMC_ICONS_URL);
+ $GLOBALS['xoopsTpl']->assign('tdmc_upload_url', TDMC_UPLOAD_URL);
+ $GLOBALS['xoopsTpl']->assign('tdmc_upload_imgtab_url', TDMC_UPLOAD_IMGTAB_URL);
+ $GLOBALS['xoopsTpl']->assign('modPathIcon16', $modPathIcon16);
+ $GLOBALS['xoopsTpl']->assign('sysPathIcon32', $sysPathIcon32);
+ // Redirect if there aren't modules
+ $countModules = $tdmcreate->getHandler('modules')->getCount();
+ if ( $countModules == 0 ) {
+ redirect_header('modules.php?op=new', 2, _AM_TDMCREATE_NOTMODULES );
+ }
+ unset($countModules);
+ // Redirect if there aren't tables
+ $handlerTables = $tdmcreate->getHandler('tables');
+ $countTables = $handlerTables->getCount();
+ if ($countTables == 0) {
+ redirect_header('tables.php?op=new', 2, _AM_TDMCREATE_NOTTABLES );
+ }
+ unset($countTables);
+ // Get the list of tables
+ $criteria = new CriteriaCompo();
+ $criteria->add(new Criteria('table_mid', $handlerTables->getVar('table_mid')));
+ $criteria->setStart($start);
$criteria->setLimit($limit);
- $criteria->setSort('table_id ASC, table_order ASC, table_name');
- $criteria->setOrder('ASC');
- $countTables = $tdmcreate->getHandler('tables')->getCount($criteria);
- $tablesAll = $tdmcreate->getHandler('tables')->getAll($criteria);
- unset($criteria);
- if ($countTables > 0) {
- $tlid = 1;
- foreach (array_keys($tablesAll) as $tid) {
- // Display tables list
- $table['id'] = $tid;
- $table['lid'] = $tlid;
- $table['mid'] = $tablesAll[$tid]->getVar('table_mid');
- $table['name'] = ucfirst($tablesAll[$tid]->getVar('table_name'));
- $table['image'] = $tablesAll[$tid]->getVar('table_image');
- $table['nbfields'] = $tablesAll[$tid]->getVar('table_nbfields');
- $table['order'] = $tablesAll[$tid]->getVar('table_order');
- $table['autoincrement'] = $tablesAll[$tid]->getVar('table_autoincrement');
- $table['blocks'] = $tablesAll[$tid]->getVar('table_blocks');
- $table['admin'] = $tablesAll[$tid]->getVar('table_admin');
- $table['user'] = $tablesAll[$tid]->getVar('table_user');
- $table['search'] = $tablesAll[$tid]->getVar('table_search');
+ $criteria->setSort('table_id ASC, table_order ASC, table_name');
+ $criteria->setOrder('ASC');
+ $countTables = $tdmcreate->getHandler('tables')->getCount($criteria);
+ $tablesAll = $tdmcreate->getHandler('tables')->getAll($criteria);
+ unset($criteria);
+ if ($countTables > 0)
+ {
+ $tlid = 1;
+ foreach (array_keys($tablesAll) as $tid)
+ {
+ // Display tables list
+ $table['id'] = $tid;
+ $table['lid'] = $tlid;
+ $table['mid'] = $tablesAll[$tid]->getVar('table_mid');
+ $table['name'] = ucfirst($tablesAll[$tid]->getVar('table_name'));
+ $table['image'] = $tablesAll[$tid]->getVar('table_image');
+ $table['nbfields'] = $tablesAll[$tid]->getVar('table_nbfields');
+ $table['order'] = $tablesAll[$tid]->getVar('table_order');
+ $table['autoincrement'] = $tablesAll[$tid]->getVar('table_autoincrement');
+ $table['blocks'] = $tablesAll[$tid]->getVar('table_blocks');
+ $table['admin'] = $tablesAll[$tid]->getVar('table_admin');
+ $table['user'] = $tablesAll[$tid]->getVar('table_user');
+ $table['search'] = $tablesAll[$tid]->getVar('table_search');
// Get the list of fields
- $criteria = new CriteriaCompo();
- $criteria->add(new Criteria('field_mid', $table['mid']));
- $criteria->add(new Criteria('field_tid', $tid));
- $criteria->setSort('field_order ASC, field_id ASC, field_name');
- $criteria->setOrder('ASC');
- $countFields = $tdmcreate->getHandler('fields')->getCount($criteria);
- $fieldsAll = $tdmcreate->getHandler('fields')->getObjects($criteria);
- unset($criteria);
- // Display fields list
- $fields = array();
- $lid = 1;
- if ($countFields > 0) {
- foreach (array_keys($fieldsAll) as $fid) {
- $field['id'] = $fid;
- $field['lid'] = $lid;
- $field['order'] = $fieldsAll[$fid]->getVar('field_order');
- $field['name'] = str_replace('_', ' ', ucfirst($fieldsAll[$fid]->getVar('field_name')));
- $field['parent'] = $fieldsAll[$fid]->getVar('field_parent');
- $field['inlist'] = $fieldsAll[$fid]->getVar('field_inlist');
- $field['inform'] = $fieldsAll[$fid]->getVar('field_inform');
- $field['admin'] = $fieldsAll[$fid]->getVar('field_admin');
- $field['user'] = $fieldsAll[$fid]->getVar('field_user');
- $field['block'] = $fieldsAll[$fid]->getVar('field_block');
- $field['main'] = $fieldsAll[$fid]->getVar('field_main');
- $field['search'] = $fieldsAll[$fid]->getVar('field_search');
- $field['required'] = $fieldsAll[$fid]->getVar('field_required');
- $fields[] = $field;
- unset($field);
- ++$lid;
- }
- }
- ++$tlid;
- unset($lid);
- $table['fields'] = $fields;
- $GLOBALS['xoopsTpl']->append('tables_list', $table);
- unset($table);
- }
- unset($tlid, $fields);
- if ($countTables > $limit) {
- include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
- $pagenav = new XoopsPageNav($countTables, $limit, $start, 'start', 'op=list&limit=' . $limit);
- $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4));
- }
- } else {
- $GLOBALS['xoopsTpl']->assign('error', _AM_TDMCREATE_THEREARENT_FIELDS);
- }
- break;
-
- case 'new':
- // Define main template
- $template_main = 'tdmcreate_fields.tpl';
- $GLOBALS['xoTheme']->addStylesheet('modules/tdmcreate/assets/css/admin/style.css');
- $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('fields.php'));
- $adminMenu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php', 'list');
- $adminMenu->addItemButton(_AM_TDMCREATE_FIELDS_LIST, 'fields.php', 'list');
- $GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
- // Form Add
- $fieldsObj =& $tdmcreate->getHandler('fields')->create();
- $form = $fieldsObj->getFormNew($fieldMid, $fieldTid, $fieldNumb, $fieldName);
- $GLOBALS['xoopsTpl']->assign('form', $form->render());
- break;
-
- case 'save':
- //
- if (!$GLOBALS['xoopsSecurity']->check()) {
+ $criteria = new CriteriaCompo();
+ $criteria->add(new Criteria('field_mid', $table['mid']));
+ $criteria->add(new Criteria('field_tid', $tid));
+ $criteria->setSort('field_order ASC, field_id ASC, field_name');
+ $criteria->setOrder('ASC');
+ $countFields = $tdmcreate->getHandler('fields')->getCount($criteria);
+ $fieldsAll = $tdmcreate->getHandler('fields')->getObjects($criteria);
+ unset($criteria);
+ // Display fields list
+ $fields = array();
+ $lid = 1;
+ if ( $countFields > 0 )
+ {
+ foreach (array_keys($fieldsAll) as $fid)
+ {
+ $field['id'] = $fid;
+ $field['lid'] = $lid;
+ $field['order'] = $fieldsAll[$fid]->getVar('field_order');
+ $field['name'] = str_replace('_', ' ', ucfirst($fieldsAll[$fid]->getVar('field_name')));
+ $field['parent'] = $fieldsAll[$fid]->getVar('field_parent');
+ $field['inlist'] = $fieldsAll[$fid]->getVar('field_inlist');
+ $field['inform'] = $fieldsAll[$fid]->getVar('field_inform');
+ $field['admin'] = $fieldsAll[$fid]->getVar('field_admin');
+ $field['user'] = $fieldsAll[$fid]->getVar('field_user');
+ $field['block'] = $fieldsAll[$fid]->getVar('field_block');
+ $field['main'] = $fieldsAll[$fid]->getVar('field_main');
+ $field['search'] = $fieldsAll[$fid]->getVar('field_search');
+ $field['required'] = $fieldsAll[$fid]->getVar('field_required');
+ $fields[] = $field;
+ unset($field);
+ $lid++;
+ }
+ }
+ $tlid++;
+ unset($lid);
+ $table['fields'] = $fields;
+ $GLOBALS['xoopsTpl']->append('tables_list', $table);
+ unset($table);
+ }
+ unset($tlid);
+ unset($fields);
+ if ( $countTables > $limit ) {
+ include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
+ $pagenav = new XoopsPageNav($countTables, $limit, $start, 'start', 'op=list&limit=' . $limit);
+ $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4));
+ }
+ } else {
+ $GLOBALS['xoopsTpl']->assign('error', _AM_TDMCREATE_THEREARENT_FIELDS);
+ }
+ break;
+
+ case 'new':
+ // Define main template
+ $template_main = 'tdmcreate_fields.tpl';
+ $GLOBALS['xoTheme']->addStylesheet( 'modules/tdmcreate/assets/css/admin/style.css' );
+ $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('fields.php'));
+ $adminMenu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php', 'list');
+ $adminMenu->addItemButton(_AM_TDMCREATE_FIELDS_LIST, 'fields.php', 'list');
+ $GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
+ // Form Add
+ $fieldsObj =& $tdmcreate->getHandler('fields')->create();
+ $form = $fieldsObj->getFormNew($fieldMid, $fieldTid, $fieldNumb, $fieldName);
+ $GLOBALS['xoopsTpl']->assign('form', $form->render());
+ break;
+
+ case 'save':
+ //
+ if ( !$GLOBALS['xoopsSecurity']->check() ) {
redirect_header('fields.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
- }
- $fieldId = XoopsRequest::getInt('field_id');
- // Fields Handler
- $fields = $tdmcreate->getHandler('fields');
- //
- $order = $fieldsObj->isNew() ? $fieldOrder + 1 : $fieldOrder;
- // Set Variables
- foreach ($_POST['field_id'] as $key => $value) {
- if (isset($value)) {
- $fieldsObj =& $fields->get($value);
- } else {
- $fieldsObj =& $fields->create();
- }
- // Set Data
- $fieldsObj->setVar('field_mid', $fieldMid);
- $fieldsObj->setVar('field_tid', $fieldTid);
- $fieldsObj->setVar('field_order', $_POST['field_name'][$key] ? $_POST['field_name'][$key] : $order);
- $fieldsObj->setVar('field_name', $_POST['field_name'][$key] ? $_POST['field_name'][$key] : '');
- $fieldsObj->setVar('field_type', $_POST['field_type'][$key] ? $_POST['field_type'][$key] : '');
- $fieldsObj->setVar('field_value', $_POST['field_value'][$key] ? $_POST['field_value'][$key] : '');
- $fieldsObj->setVar('field_attribute', ($_POST['field_attribute'][$key] ? $_POST['field_attribute'][$key] : '');
- $fieldsObj->setVar('field_null', $_POST['field_null'][$key] ? $_POST['field_null'][$key] : '');
- $fieldsObj->setVar('field_default', $_POST['field_default'][$key] ? $_POST['field_default'][$key] : '');
- $fieldsObj->setVar('field_key', $_POST['field_key'][$key] ? $_POST['field_key'][$key] : '');
- $fieldsObj->setVar('field_element', $_POST['field_element'][$key] ? $_POST['field_element'][$key] : '');
- $fieldsObj->setVar('field_parent', ($_REQUEST['field_parent'][$key] == 1) ? 1 : 0);
- $fieldsObj->setVar('field_inlist', ($_REQUEST['field_inlist'][$key] == 1) ? 1 : 0);
- $fieldsObj->setVar('field_inform', ($_REQUEST['field_inform'][$key] == 1) ? 1 : 0);
- $fieldsObj->setVar('field_admin', ($_REQUEST['field_admin'][$key] == 1) ? 1 : 0);
- $fieldsObj->setVar('field_user', ($_REQUEST['field_user'][$key] == 1) ? 1 : 0);
- $fieldsObj->setVar('field_block', ($_REQUEST['field_block'][$key] == 1) ? 1 : 0);
- $fieldsObj->setVar('field_main', ($key == $_REQUEST['field_main'] ? 1 : 0));
- $fieldsObj->setVar('field_search', ($_REQUEST['field_search'][$key] == 1) ? 1 : 0);
- $fieldsObj->setVar('field_required', ($_REQUEST['field_required'][$key] == 1) ? 1 : 0);
+ }
+ $fieldId = XoopsRequest::getInt('field_id');
+ // Fields Handler
+ $fields = $tdmcreate->getHandler('fields');
+ // Set Variables
+ foreach($_POST['field_id'] as $key => $value)
+ {
+ if(isset($value)){
+ $fieldsObj =& $fields->get($value);
+ } else {
+ $fieldsObj =& $fields->create();
+ }
+ $fieldOrder = XoopsRequest::getInt('field_order');
+ $order = $fieldsObj->isNew() ? $fieldOrder++ : $fieldOrder;
+ // Set Data
+ $fieldsObj->setVar( 'field_mid', $fieldMid );
+ $fieldsObj->setVar( 'field_tid', $fieldTid );
+ $fieldsObj->setVar( 'field_order', $order );
+ $fieldsObj->setVar( 'field_name', $_POST['field_name'][$key]);
+ $fieldsObj->setVar( 'field_type', $_POST['field_type'][$key]);
+ $fieldsObj->setVar( 'field_value', $_POST['field_value'][$key]);
+ $fieldsObj->setVar( 'field_attribute', $_POST['field_attribute'][$key]);
+ $fieldsObj->setVar( 'field_null', $_POST['field_null'][$key]);
+ $fieldsObj->setVar( 'field_default', $_POST['field_default'][$key]);
+ $fieldsObj->setVar( 'field_key', $_POST['field_key'][$key]);
+ $fieldsObj->setVar( 'field_element', $_POST['field_element'][$key]);
+ $fieldsObj->setVar( 'field_parent', (1 == $_REQUEST['field_parent'][$key]) ? 1 : 0);
+ $fieldsObj->setVar( 'field_inlist', (1 == $_REQUEST['field_inlist'][$key]) ? 1 : 0);
+ $fieldsObj->setVar( 'field_inform', (1 == $_REQUEST['field_inform'][$key]) ? 1 : 0);
+ $fieldsObj->setVar( 'field_admin', (1 == $_REQUEST['field_admin'][$key]) ? 1 : 0);
+ $fieldsObj->setVar( 'field_user', (1 == $_REQUEST['field_user'][$key]) ? 1 : 0);
+ $fieldsObj->setVar( 'field_block', (1 == $_REQUEST['field_block'][$key]) ? 1 : 0);
+ $fieldsObj->setVar( 'field_main', ($key == $_REQUEST['field_main'] ? 1 : 0));
+ $fieldsObj->setVar( 'field_search', (1 == $_REQUEST['field_search'][$key]) ? 1 : 0);
+ $fieldsObj->setVar( 'field_required', (1 == $_REQUEST['field_required'][$key]) ? 1 : 0);
// Insert Data
$tdmcreate->getHandler('fields')->insert($fieldsObj);
- }
- // Get table name from field table id
- $tables =& $tdmcreate->getHandler('tables')->get($fieldTid);
- $tableName = $tables->getVar('table_name');
- // Set field elements
- if ($fieldsObj->isNew()) {
- // Fields Elements Handler
- $fieldelementObj =& $tdmcreate->getHandler('fieldelements')->create();
- $fieldelementObj->setVar('fieldelement_mid', $fieldMid);
- $fieldelementObj->setVar('fieldelement_tid', $fieldTid);
- $fieldelementObj->setVar('fieldelement_name', 'Table : ' . ucfirst($tableName));
- $fieldelementObj->setVar('fieldelement_value', 'XoopsFormTables-' . ucfirst($tableName));
- // Insert new field element id for table name
- if (!$tdmcreate->getHandler('fieldelements')->insert($fieldelementObj)) {
- $GLOBALS['xoopsTpl']->assign('error', $fieldelementObj->getHtmlErrors() . ' Field element');
- }
- redirect_header('fields.php', 2, sprintf(_AM_TDMCREATE_FIELDS_FORM_SAVED_OK, $tableName));
- } else {
- // Needed code from table name by field_tid
- redirect_header('fields.php', 2, sprintf(_AM_TDMCREATE_FIELDS_FORM_UPDATED_OK, $tableName));
- }
+ }
+ // Get table name from field table id
+ $tables =& $tdmcreate->getHandler('tables')->get($fieldTid);
+ $tableName = $tables->getVar('table_name');
+ // Set field elements
+ if ($fieldsObj->isNew()) {
+ // Fields Elements Handler
+ $fieldelementObj =& $tdmcreate->getHandler('fieldelements')->create();
+ $fieldelementObj->setVar( 'fieldelement_mid', $fieldMid );
+ $fieldelementObj->setVar( 'fieldelement_tid', $fieldTid );
+ $fieldelementObj->setVar( 'fieldelement_name', 'Table : '.ucfirst($tableName) );
+ $fieldelementObj->setVar( 'fieldelement_value', 'XoopsFormTables-'.ucfirst($tableName) );
+ // Insert new field element id for table name
+ if (!$tdmcreate->getHandler('fieldelements')->insert($fieldelementObj) ) {
+ $GLOBALS['xoopsTpl']->assign('error', $fieldelementObj->getHtmlErrors() . ' Field element');
+ }
+ redirect_header('fields.php', 2, sprintf(_AM_TDMCREATE_FIELDS_FORM_SAVED_OK, $tableName));
+ } else {
+ // Needed code from table name by field_tid
+ redirect_header('fields.php', 2, sprintf(_AM_TDMCREATE_FIELDS_FORM_UPDATED_OK, $tableName));
+ }
//
- $GLOBALS['xoopsTpl']->assign('error', $fieldsObj->getHtmlErrors());
- $form = $fieldsObj->getForm(null, $fieldTid);
- $GLOBALS['xoopsTpl']->assign('form', $form->render());
- break;
-
- case 'edit':
- // Define main template
- $template_main = 'tdmcreate_fields.tpl';
- $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('fields.php'));
- $adminMenu->addItemButton(_AM_TDMCREATE_ADD_TABLE, 'tables.php?op=new', 'add');
- $adminMenu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php', 'list');
- $adminMenu->addItemButton(_AM_TDMCREATE_FIELDS_LIST, 'fields.php', 'list');
- $GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
- // Form Edit
- $fieldId = XoopsRequest::getInt('field_id');
- $fieldsObj = $tdmcreate->getHandler('fields')->get($fieldId);
- $form = $fieldsObj->getFormEdit($fieldMid, $fieldTid);
- $GLOBALS['xoopsTpl']->assign('form', $form->render());
- break;
-
- case 'order':
- // Initialize fields handler
+ $GLOBALS['xoopsTpl']->assign('error', $fieldsObj->getHtmlErrors());
+ $form = $fieldsObj->getForm(null, $fieldTid);
+ $GLOBALS['xoopsTpl']->assign('form', $form->render());
+ break;
+
+ case 'edit':
+ // Define main template
+ $template_main = 'tdmcreate_fields.tpl';
+ $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('fields.php'));
+ $adminMenu->addItemButton(_AM_TDMCREATE_ADD_TABLE, 'tables.php?op=new', 'add');
+ $adminMenu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php', 'list');
+ $adminMenu->addItemButton(_AM_TDMCREATE_FIELDS_LIST, 'fields.php', 'list');
+ $GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
+ // Form Edit
+ $fieldId = XoopsRequest::getInt('field_id');
+ $fieldsObj = $tdmcreate->getHandler('fields')->get( $fieldId );
+ $form = $fieldsObj->getFormEdit($fieldMid, $fieldTid);
+ $GLOBALS['xoopsTpl']->assign('form', $form->render());
+ break;
+
+ case 'order':
+ // Initialize fields handler
$fieldsObj = $tdmcreate->getHandler('fields');
- if (isset($_POST['forder'])) {
+ if ( isset($_POST['forder'] ) ) {
$i = 0;
- foreach ($_POST['forder'] as $order) {
- if ($order > 0) {
+ foreach($_POST['forder'] as $order) {
+ if( $order > 0 ) {
$fieldOrder = $fieldsObj->get($order);
$fieldOrder->setVar('field_order', $i);
if (!$fieldsObj->insert($fieldOrder)) {
- $error = true;
+ $error=true;
}
- ++$i;
+ $i++;
}
}
- redirect_header('fields.php', 5, _AM_TDMCREATE_FIELD_ORDER_ERROR);
- unset($i);
+ redirect_header('fields.php', 5, _AM_TDMCREATE_FIELD_ORDER_ERROR);
+ unset($i);
}
exit;
- break;
+ break;
- case 'delete':
- $tablesObj =& $tdmcreate->getHandler('tables')->get($fieldTid);
- if (isset($_REQUEST['ok']) && 1 == $_REQUEST['ok']) {
- if (!$GLOBALS['xoopsSecurity']->check()) {
- redirect_header('fields.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
- }
- if ($tdmcreate->getHandler('tables')->delete($tablesObj)) {
- redirect_header('fields.php', 3, _AM_TDMCREATE_FORMDELOK);
- } else {
- echo $tablesObj->getHtmlErrors();
- }
- } else {
- xoops_confirm(array('ok' => 1, 'field_tid' => $fieldTid, 'op' => 'delete'), $_SERVER['REQUEST_URI'], sprintf(_AM_TDMCREATE_FORMSUREDEL, $tablesObj->getVar('table_name')));
- }
- break;
-
- case 'display':
+ case 'delete':
+ $tablesObj =& $tdmcreate->getHandler('tables')->get($fieldTid);
+ if (isset($_REQUEST['ok']) && $_REQUEST['ok'] == 1) {
+ if ( !$GLOBALS['xoopsSecurity']->check() ) {
+ redirect_header('fields.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
+ }
+ if ($tdmcreate->getHandler('tables')->delete($tablesObj)) {
+ redirect_header('fields.php', 3, _AM_TDMCREATE_FORMDELOK);
+ } else {
+ echo $tablesObj->getHtmlErrors();
+ }
+ } else {
+ xoops_confirm(array('ok' => 1, 'field_tid' => $fieldTid, 'op' => 'delete'), $_SERVER['REQUEST_URI'], sprintf(_AM_TDMCREATE_FORMSUREDEL, $tablesObj->getVar('table_name')));
+ }
+ break;
+
+ case 'display':
// Fields Handler
$fields = $tdmcreate->getHandler('fields');
//
foreach ($_POST['field_id'] as $key => $value) {
$fieldsObj =& $fields->get($value);
- $fieldsObj->setVar('field_parent', ($_REQUEST['field_parent'][$key] == 1) ? 0 : 1);
- $fieldsObj->setVar('field_inlist', ($_REQUEST['field_inlist'][$key] == 1) ? 0 : 1);
- $fieldsObj->setVar('field_inform', ($_REQUEST['field_inform'][$key] == 1) ? 0 : 1);
- $fieldsObj->setVar('field_admin', ($_REQUEST['field_admin'][$key] == 1) ? 0 : 1);
- $fieldsObj->setVar('field_user', ($_REQUEST['field_user'][$key] == 1) ? 0 : 1);
- $fieldsObj->setVar('field_block', ($_REQUEST['field_block'][$key] == 1) ? 0 : 1);
+ $fieldsObj->setVar('field_parent', (1 == $_REQUEST['field_parent'][$key]) ? 0 : 1);
+ $fieldsObj->setVar('field_inlist', (1 == $_REQUEST['field_inlist'][$key]) ? 0 : 1);
+ $fieldsObj->setVar('field_inform', (1 == $_REQUEST['field_inform'][$key]) ? 0 : 1);
+ $fieldsObj->setVar('field_admin', (1 == $_REQUEST['field_admin'][$key]) ? 0 : 1);
+ $fieldsObj->setVar('field_user', (1 == $_REQUEST['field_user'][$key]) ? 0 : 1);
+ $fieldsObj->setVar('field_block', (1 == $_REQUEST['field_block'][$key]) ? 0 : 1);
$fieldsObj->setVar('field_main', ($key == $_REQUEST['field_main']) ? 0 : 1);
- $fieldsObj->setVar('field_search', ($_REQUEST['field_search'][$key] == 1) ? 0 : 1);
- $fieldsObj->setVar('field_required', ($_REQUEST['field_required'][$key] == 1) ? 0 : 1);
+ $fieldsObj->setVar('field_search', (1 == $_REQUEST['field_search'][$key]) ? 0 : 1);
+ $fieldsObj->setVar('field_required', (1 == $_REQUEST['field_required'][$key]) ? 0 : 1);
}
if ($fiel...
[truncated message content] |
|
From: <txm...@us...> - 2015-05-03 07:22:26
|
Revision: 13053
http://sourceforge.net/p/xoops/svn/13053
Author: txmodxoops
Date: 2015-05-03 07:22:23 +0000 (Sun, 03 May 2015)
Log Message:
-----------
Autoloader for all classes
Now is not needed to add link in common.php file to the new classes
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/TDMCreateAutoload.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateArchitecture.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/language/LanguageAdmin.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/include/common.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/templates/admin/tdmcreate_fields.tpl
Added Paths:
-----------
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateAutoload.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/TDMCreateAutoload.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/TDMCreateAutoload.php 2015-05-02 13:42:44 UTC (rev 13052)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/TDMCreateAutoload.php 2015-05-03 07:22:23 UTC (rev 13053)
@@ -16,196 +16,42 @@
* @package tdmcreate
* @since 2.5.0
* @author Txmod Xoops http://www.txmodxoops.org
- * @version $Id: autoloader.php 12258 2014-01-02 09:33:29Z timgno $
+ * @version $Id: TDMCreateAutoload.php 12258 2014-01-02 09:33:29Z timgno $
*/
defined('XOOPS_ROOT_PATH') or die('Restricted access');
/**
* @since 1.91
*/
-class TDMCreateAutoload
-{
- /**
- * File where classes index is stored
- */
- const INDEX_FILE = 'cache/class_index.php';
+// Autoload Function
+ini_set('display_errors',1);
+error_reporting(E_ALL|E_STRICT);
- /**
- * @var Autoload
- */
- protected static $instance;
+function application_autoloader($class) {
+ $classFilename = $class.'.php';
+ $cacheFile = __DIR__ . '/cache/classpaths.cache';
+ $pathCache = (file_exists($cacheFile)) ? unserialize(file_get_contents($cacheFile)) : array();
+ if (!is_array($pathCache)) { $pathCache = array(); }
+
+ if (array_key_exists($class, $pathCache)) {
+ /* Load class using path from cache file (if the file still exists) */
+ if (file_exists($pathCache[$class])) { require_once $pathCache[$class]; }
- /**
- * @var string module directory
- */
- protected $mod_dir;
+ } else {
+ /* Determine the location of the file within the $class_root and, if found, load and cache it */
+ $directories = new RecursiveDirectoryIterator(__DIR__);
+ foreach(new RecursiveIteratorIterator($directories) as $file) {
+ if ($file->getFilename() == $classFilename) {
+ $fullPath = $file->getRealPath();
+ $pathCache[$class] = $fullPath;
+ require_once $fullPath;
+ break;
+ }
+ }
+ }
- /**
- * @var array array('classname' => 'path/to/filename')
- */
- public $index = array();
-
- protected static $class_aliases = array('Autoload' => 'TDMCreateAutoload');
-
- /**
- *
- */
- public function __construct()
- {
- $this->mod_dir = TDMC_PATH . '/';
- $file = TDMC_CLASSES_PATH . TDMCreateAutoload::INDEX_FILE;
- if (@filemtime($file) && is_readable($file)) {
- $this->index = include($file);
- } else {
- $this->generateIndex();
- }
- }
-
- /**
- * Get instance of autoload
- *
- * @return TDMCreateAutoload
- */
- public static function getInstance()
- {
- if (!TDMCreateAutoload::$instance) {
- TDMCreateAutoload::$instance = new TDMCreateAutoload();
- }
-
- return TDMCreateAutoload::$instance;
- }
-
- /**
- * Retrieve informations about a class in classes index and load it
- *
- * @param string $classname
- * @return mixed
- */
- public function load($classname)
- {
- // Retrocompatibility
- if (isset(TDMCreateAutoload::$class_aliases[$classname]) && !interface_exists($classname, false) && !class_exists($classname, false)) {
- return eval('class ' . $classname . ' extends ' . TDMCreateAutoload::$class_aliases[$classname] . ' {}');
- }
- // regenerate the class index if the requested file doesn't exists
- if ((isset($this->index[$classname]) && $this->index[$classname]['path'] && !is_file($this->mod_dir . $this->index[$classname]['path']))) {
- $this->generateIndex();
- }
- // Call directly class
- if (isset($this->index[$classname]['path']) && $this->index[$classname]['path']) {
- require($this->mod_dir . $this->index[$classname]['path']);
- }
- return null;
- }
-
- /**
- * Generate classes index
- */
- public function generateIndex()
- {
- $classes = array_merge($this->getClassesFromDir('class/'),
- $this->getClassesFromDir('class/files/'),
- $this->getClassesFromDir('class/files/admin/'),
- $this->getClassesFromDir('class/files/blocks/'),
- $this->getClassesFromDir('class/files/classes/'),
- $this->getClassesFromDir('class/files/css/'),
- $this->getClassesFromDir('class/files/docs/'),
- $this->getClassesFromDir('class/files/include/'),
- $this->getClassesFromDir('class/files/language/'),
- $this->getClassesFromDir('class/files/sql/'),
- $this->getClassesFromDir('class/files/templates/'),
- $this->getClassesFromDir('class/files/user/'));
- ksort($classes);
- $content = '<?php return ' . var_export($classes, true) . '; ?>';
-
- // Write classes index on disc to cache it
- $filename = TDMC_CLASSES_PATH . TDMCreateAutoload::INDEX_FILE;
- $filename_tmp = tempnam(dirname($filename), basename($filename . '.'));
- if ($filename_tmp !== false && file_put_contents($filename_tmp, $content) !== false) {
- if (!@rename($filename_tmp, $filename)) {
- unlink($filename_tmp);
- } else {
- @chmod($filename, 0644);
- }
- }
- // $filename_tmp couldn't be written . $filename should be there anyway (even if outdated), no need to die.
- else {
- error_log('Cannot write temporary file ' . $filename_tmp);
- }
- $this->index = $classes;
- }
-
- /**
- * Retrieve recursively all classes in a directory and its subdirectories
- *
- * @param string $path Relative path from root to the directory
- * @return array
- */
- protected function getClassesFromDir($path)
- {
- $classes = array();
- $mod_dir = $this->mod_dir;
-
- foreach (scandir($mod_dir . $path) as $file) {
- if ($file[0] != '.') {
- if (is_dir($mod_dir . $path . $file)) {
- $classes = array_merge($classes, $this->getClassesFromDir($path . $file . '/'));
- } else {
- if (substr($file, -4) == '.php') {
- $content = file_get_contents($mod_dir . $path . $file);
- $pattern = '#\W((abstract\s+)?class|interface)\s+(?P<classname>' . basename($file, '.php') . '?)' . '(?:\s+extends\s+[a-z][a-z0-9_]*)?(?:\s+implements\s+[a-z][a-z0-9_]*(?:\s*,\s*[a-z][a-z0-9_]*)*)?\s*\{#i';
- if (preg_match($pattern, $content, $m)) {
- $classes[$m['classname']] = array('path' => $path . $file);
- }
- }
- }
- }
- }
-
- return $classes;
- }
-
- /**
- * @param $classname
- * @return null
- */
- public function getClassPath($classname)
- {
- return (isset($this->index[$classname]) && isset($this->index[$classname]['path'])) ? $this->index[$classname]['path'] : null;
- }
+ $serialized_paths = serialize($pathCache);
+ if ($serialized_paths != $pathCache) { file_put_contents($cacheFile, serialize($pathCache)); }
}
-/*
- function autoLoader($className) {
- // Directories
- $directories = array(
- '',
- 'files/',
- 'files/admin/',
- 'files/blocks/',
- 'files/classes/',
- 'files/css/',
- 'files/docs/',
- 'files/include/',
- 'files/language/',
- 'files/sql/',
- 'files/templates/user/',
- 'files/templates/admin/',
- 'files/templates/blocks/',
- 'files/user/'
- );
- // File naming format
- $fileNameFormats = array( '%s.php' );
-
- foreach($directories as $directory) {
- foreach($fileNameFormats as $fileNameFormat) {
- $path = $directory.sprintf($fileNameFormat, $className);
- if(file_exists($path)) {
- include_once $path;
- return true;
- }
- }
- }
- return false;
-}*/
-//spl_autoload_register('TDMCreateAutoload');
+spl_autoload_register('application_autoloader');
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/fields.php 2015-05-02 13:42:44 UTC (rev 13052)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/fields.php 2015-05-03 07:22:23 UTC (rev 13053)
@@ -19,9 +19,10 @@
* @version $Id: 1.91 fields.php 12258 2014-01-02 09:33:29Z timgno $
*/
defined('XOOPS_ROOT_PATH') or die('Restricted access');
-require_once 'html/TDMCreateFormLabel.php';
+/*require_once 'html/TDMCreateFormLabel.php';
require_once 'form/TDMCreateFormRadio.php';
-require_once 'form/TDMCreateThemeForm.php';
+require_once 'form/TDMCreateThemeForm.php';*/
+include __DIR__ . '/TDMCreateAutoload.php';
/*
* @Class TDMCreateFields
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateArchitecture.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateArchitecture.php 2015-05-02 13:42:44 UTC (rev 13052)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateArchitecture.php 2015-05-03 07:22:23 UTC (rev 13053)
@@ -19,7 +19,8 @@
* @version $Id: TDMCreateArchitecture.php 12258 2014-01-02 09:33:29Z timgno $
*/
defined('XOOPS_ROOT_PATH') or die('Restricted access');
-require_once 'TDMCreateStructure.php';
+// Autoloader Classes
+include __DIR__ . '/TDMCreateAutoload.php';
/**
* Class TDMCreateArchitecture
@@ -357,7 +358,7 @@
$ret[] = $adminTemplatesHeader->render();
// Language Admin File
$languageAdmin = LanguageAdmin::getInstance();
- $languageAdmin->write($module, $tables, 'admin.php');
+ $languageAdmin->write($module, $table, $tables, 'admin.php');
$ret[] = $languageAdmin->render();
}
// Class Helper File
@@ -516,4 +517,4 @@
// Return Array
return $ret;
}
-}
+}
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateAutoload.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateAutoload.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateAutoload.php 2015-05-03 07:22:23 UTC (rev 13053)
@@ -0,0 +1,57 @@
+<?php
+/*
+ You may not change or alter any portion of this comment or credits
+ of supporting developers from this source code or any supporting source code
+ which is considered copyrighted (c) material of the original comment or credit authors.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+/**
+ * tdmcreate module
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package tdmcreate
+ * @since 2.5.0
+ * @author Txmod Xoops http://www.txmodxoops.org
+ * @version $Id: TDMCreateAutoload.php 12258 2014-01-02 09:33:29Z timgno $
+ */
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
+
+/**
+ * @since 1.91
+ */
+// Autoload Function
+ini_set('display_errors',1);
+error_reporting(E_ALL|E_STRICT);
+
+function applicationAutoloader($class) {
+ $classFilename = $class.'.php';
+ $cacheFile = __DIR__ . '/cache/classpaths.cache';
+ $pathCache = (file_exists($cacheFile)) ? unserialize(file_get_contents($cacheFile)) : array();
+ if (!is_array($pathCache)) { $pathCache = array(); }
+
+ if (array_key_exists($class, $pathCache)) {
+ /* Load class using path from cache file (if the file still exists) */
+ if (file_exists($pathCache[$class])) { require_once $pathCache[$class]; }
+
+ } else {
+ /* Determine the location of the file within the $class_root and, if found, load and cache it */
+ $directories = new RecursiveDirectoryIterator(__DIR__);
+ foreach(new RecursiveIteratorIterator($directories) as $file) {
+ if ($file->getFilename() == $classFilename) {
+ $fullPath = $file->getRealPath();
+ $pathCache[$class] = $fullPath;
+ require_once $fullPath;
+ break;
+ }
+ }
+ }
+
+ $serialized_paths = serialize($pathCache);
+ if ($serialized_paths != $pathCache) { file_put_contents($cacheFile, serialize($pathCache)); }
+}
+
+spl_autoload_register('applicationAutoloader');
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/language/LanguageAdmin.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/language/LanguageAdmin.php 2015-05-02 13:42:44 UTC (rev 13052)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/language/LanguageAdmin.php 2015-05-03 07:22:23 UTC (rev 13053)
@@ -69,10 +69,11 @@
* @param string $filename
* @param $filename
*/
- public function write($module, $tables, $filename)
+ public function write($module, $table, $tables, $filename)
{
$this->setModule($module);
- $this->setTables($tables);
+ $this->setTable($table);
+ $this->setTables($tables);
$this->setFileName($filename);
}
@@ -252,19 +253,17 @@
public function render()
{
$module = $this->getModule();
- $tables = $this->getTables();
+ $table = $this->getTable();
+ $tables = $this->getTables();
$filename = $this->getFileName();
$moduleDirname = $module->getVar('mod_dirname');
$language = $this->getLanguage($moduleDirname, 'AM');
$content = $this->getHeaderFilesComments($module, $filename);
- foreach (array_keys($tables) as $t) {
- $tablePermissions = $tables[$t]->getVar('table_permissions');
- }
if (is_array($tables)) {
$content .= $this->getLanguageAdminIndex($language, $tables);
$content .= $this->getLanguageAdminPages($language, $tables);
$content .= $this->getLanguageAdminClass($language, $tables);
- if (1 == $tablePermissions) {
+ if (1 == $table->getVar('table_permissions')) {
$content .= $this->getLanguageAdminPermissions($language);
}
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/include/common.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/include/common.php 2015-05-02 13:42:44 UTC (rev 13052)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/include/common.php 2015-05-03 07:22:23 UTC (rev 13053)
@@ -49,68 +49,4 @@
// Xoops Request
include_once XOOPS_ROOT_PATH . '/class/xoopsrequest.php';
include_once TDMC_PATH . '/include/functions.php';
-//require_once(TDMC_CLASSES_PATH.'/TDMCreateAutoload.php');
-//spl_autoload_register(array(TDMCreateAutoload::getInstance(), 'load'));
-// Include files
-$cf = '/class/files/';
-$cfa = '/class/files/admin/';
-$cfb = '/class/files/blocks/';
-$cfcl = '/class/files/classes/';
-$cfcs = '/class/files/css/';
-$cfd = '/class/files/docs/';
-$cfi = '/class/files/include/';
-$cfl = '/class/files/language/';
-$cfs = '/class/files/sql/';
-$cftu = '/class/files/templates/user/';
-$cfta = '/class/files/templates/admin/';
-$cftb = '/class/files/templates/blocks/';
-$cfu = '/class/files/user/';
-include_once TDMC_PATH . '/class/TDMCreateHelper.php';
-include_once TDMC_PATH . '/class/TDMCreateSession.php';
-require_once TDMC_PATH . $cf . 'TDMCreateFile.php';
-include_once TDMC_PATH . $cfa . 'AdminAbout.php';
-include_once TDMC_PATH . $cfa . 'AdminFooter.php';
-include_once TDMC_PATH . $cfa . 'AdminHeader.php';
-include_once TDMC_PATH . $cfa . 'AdminIndex.php';
-include_once TDMC_PATH . $cfa . 'AdminMenu.php';
-include_once TDMC_PATH . $cfa . 'AdminPages.php';
-include_once TDMC_PATH . $cfa . 'AdminPermissions.php';
-include_once TDMC_PATH . $cfb . 'BlocksFiles.php';
-include_once TDMC_PATH . $cfcl . 'ClassFiles.php';
-include_once TDMC_PATH . $cfcl . 'ClassHelper.php';
-include_once TDMC_PATH . $cfcs . 'CssStyles.php';
-include_once TDMC_PATH . $cfd . 'DocsChangelog.php';
-include_once TDMC_PATH . $cfd . 'DocsFiles.php';
-include_once TDMC_PATH . $cfi . 'IncludeComments.php';
-include_once TDMC_PATH . $cfi . 'IncludeCommentFunctions.php';
-include_once TDMC_PATH . $cfi . 'IncludeCommon.php';
-include_once TDMC_PATH . $cfi . 'IncludeFunctions.php';
-include_once TDMC_PATH . $cfi . 'IncludeInstall.php';
-include_once TDMC_PATH . $cfi . 'IncludeJquery.php';
-include_once TDMC_PATH . $cfi . 'IncludeNotifications.php';
-include_once TDMC_PATH . $cfi . 'IncludeSearch.php';
-include_once TDMC_PATH . $cfi . 'IncludeUpdate.php';
-include_once TDMC_PATH . $cfl . 'LanguageAdmin.php';
-include_once TDMC_PATH . $cfl . 'LanguageBlocks.php';
-include_once TDMC_PATH . $cfl . 'LanguageHelp.php';
-include_once TDMC_PATH . $cfl . 'LanguageMailTpl.php';
-include_once TDMC_PATH . $cfl . 'LanguageMain.php';
-include_once TDMC_PATH . $cfl . 'LanguageModinfo.php';
-include_once TDMC_PATH . $cfs . 'SqlFile.php';
-include_once TDMC_PATH . $cfta . 'TemplatesAdminAbout.php';
-include_once TDMC_PATH . $cfta . 'TemplatesAdminHeader.php';
-include_once TDMC_PATH . $cfta . 'TemplatesAdminIndex.php';
-include_once TDMC_PATH . $cfta . 'TemplatesAdminFooter.php';
-include_once TDMC_PATH . $cfta . 'TemplatesAdminPages.php';
-include_once TDMC_PATH . $cfta . 'TemplatesAdminPermissions.php';
-include_once TDMC_PATH . $cftb . 'TemplatesBlocks.php';
-include_once TDMC_PATH . $cftu . 'TemplatesUserHeader.php';
-include_once TDMC_PATH . $cftu . 'TemplatesUserIndex.php';
-include_once TDMC_PATH . $cftu . 'TemplatesUserFooter.php';
-include_once TDMC_PATH . $cftu . 'TemplatesUserPages.php';
-include_once TDMC_PATH . $cfu . 'UserFooter.php';
-include_once TDMC_PATH . $cfu . 'UserHeader.php';
-include_once TDMC_PATH . $cfu . 'UserIndex.php';
-include_once TDMC_PATH . $cfu . 'UserPages.php';
-include_once TDMC_PATH . $cfu . 'UserNotificationUpdate.php';
-include_once TDMC_PATH . $cfu . 'UserXoopsVersion.php';
+include_once TDMC_PATH . '/class/TDMCreateHelper.php';
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/templates/admin/tdmcreate_fields.tpl
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/templates/admin/tdmcreate_fields.tpl 2015-05-02 13:42:44 UTC (rev 13052)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/templates/admin/tdmcreate_fields.tpl 2015-05-03 07:22:23 UTC (rev 13053)
@@ -73,4 +73,4 @@
<div class="spacer"><{$form}></div>
<{/if}>
<!-- Footer -->
-<{includeq file="db:tdmcreate_footer.tpl"}>
+<{includeq file="db:tdmcreate_footer.tpl"}>
\ No newline at end of file
|
|
From: <txm...@us...> - 2015-05-03 12:51:27
|
Revision: 13054
http://sourceforge.net/p/xoops/svn/13054
Author: txmodxoops
Date: 2015-05-03 12:51:24 +0000 (Sun, 03 May 2015)
Log Message:
-----------
Added field table_solename in tables to distinguish the singular name from the plural to the singular name.
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateArchitecture.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminPages.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminPermissions.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/classes/ClassFiles.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/classes/ClassFormElements.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/include/IncludeInstall.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/language/LanguageAdmin.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/language/LanguageDefines.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/sql/SqlFile.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/templates/admin/TemplatesAdminPages.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/user/UserObjects.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/user/UserXoopsVersion.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/language/english/admin.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/sql/mysql.sql
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/tables.php 2015-05-03 07:22:23 UTC (rev 13053)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/tables.php 2015-05-03 12:51:24 UTC (rev 13054)
@@ -171,10 +171,11 @@
$tablesObj->setVars(array(
'table_mid' => $tableMid,
'table_name' => $_POST['table_name'],
+ 'table_solename' => $_POST['table_solename'],
'table_category' => ((1 == $_REQUEST['table_category']) ? 1 : 0),
+ 'table_fieldname' => $tableFieldname,
'table_nbfields' => $tableNumbFields,
- 'table_order' => $order,
- 'table_fieldname' => $tableFieldname));
+ 'table_order' => $order));
//Form table_image
include_once XOOPS_ROOT_PATH . '/class/uploader.php';
$uploaddir = is_dir(XOOPS_ICONS32_PATH) ? XOOPS_ICONS32_PATH : TDMC_UPLOAD_IMGTAB_PATH;
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateArchitecture.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateArchitecture.php 2015-05-03 07:22:23 UTC (rev 13053)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateArchitecture.php 2015-05-03 12:51:24 UTC (rev 13054)
@@ -244,7 +244,6 @@
$modId = $module->getVar('mod_id');
$moduleDirname = $module->getVar('mod_dirname');
$uploadTablesIcons32 = $this->structure->getUploadPath() . '/images/tables';
- $framePathIcon32 = XOOPS_ROOT_PATH . '/Frameworks/moduleclasses/icons/32';
$icon32 = 'assets/icons/32';
// Id of tables
$criteriaTables = new CriteriaCompo();
@@ -271,7 +270,7 @@
// Copy of tables images file
if (file_exists($uploadTableImage = $uploadTablesIcons32 . '/' . $tableImage)) {
$this->structure->copyFile($icon32, $uploadTableImage, $tableImage);
- } elseif (file_exists($uploadTableImage = $framePathIcon32 . '/' . $tableImage)) {
+ } elseif (file_exists($uploadTableImage = XOOPS_ICONS32_PATH . '/' . $tableImage)) {
$this->structure->copyFile($icon32, $uploadTableImage, $tableImage);
}
// Creation of admin files
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminPages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminPages.php 2015-05-03 07:22:23 UTC (rev 13053)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminPages.php 2015-05-03 12:51:24 UTC (rev 13054)
@@ -96,7 +96,8 @@
switch (\$op)
{\n
EOT;
- return $ret;
+
+ return $ret;
}
/*
@@ -111,13 +112,16 @@
* @param $fpmf
* @return string
*/
- public function getAdminPagesList($moduleDirname, $table, $tableFieldname, $language, $fields, $fpif, $fieldInForm, $fpmf)
+ public function getAdminPagesList($moduleDirname, $table, $language, $fields, $fpif, $fieldInForm, $fpmf)
{
$stuModuleDirname = strtoupper($moduleDirname);
$tableName = $table->getVar('table_name');
+ $tableSoleName = $table->getVar('table_solename');
+ $tableFieldname = $table->getVar('table_fieldname');
+ $stuTableName = strtoupper($tableName);
+ $stuTableSoleName = strtoupper($tableSoleName);
+ $stuTableFieldname = strtoupper($tableFieldname);
$tableAutoincrement = $table->getVar('table_autoincrement');
- $stuTableName = strtoupper($tableName);
- $stuTableFieldname = strtoupper($tableFieldname);
$ret = <<<EOT
case 'list':
default:
@@ -128,7 +132,7 @@
EOT;
if (1 == $fieldInForm) {
$ret .= <<<EOT
- \$adminMenu->addItemButton({$language}ADD_{$stuTableFieldname}, '{$tableName}.php?op=new', 'add');
+ \$adminMenu->addItemButton({$language}ADD_{$stuTableSoleName}, '{$tableName}.php?op=new', 'add');
\$GLOBALS['xoopsTpl']->assign('buttons', \$adminMenu->renderButton());\n
EOT;
}
@@ -153,7 +157,7 @@
$fieldName = $fields[$f]->getVar('field_name');
$fieldParent = $fields[$f]->getVar('field_parent');
// Verify if table_fieldname is not empty
- $lpFieldName = !empty($tableFieldname) ? substr($fieldName, 0, strpos($fieldName, '_')) : $tableName;
+ $lpFieldName = !empty($tableFieldname) ? substr($fieldName, 0, strpos($fieldName, '_')) : $tableSoleName;
$rpFieldName = $this->tdmcfile->getRightString($fieldName);
//
$fieldElement = $fields[$f]->getVar('field_element');
@@ -219,7 +223,8 @@
}
break;\n
EOT;
- return $ret;
+
+ return $ret;
}
/*
@@ -244,7 +249,8 @@
\$GLOBALS['xoopsTpl']->assign('form', \$form->render());
break;\n
EOT;
- return $ret;
+
+ return $ret;
}
/*
@@ -312,7 +318,8 @@
\$GLOBALS['xoopsTpl']->assign('form', \$form->render());
break;\n
EOT;
- return $ret;
+
+ return $ret;
}
/*
@@ -324,14 +331,18 @@
* @param string $fpif
* @return string
*/
- public function getAdminPagesEdit($moduleDirname, $tableName, $tableFieldname, $language, $fpif)
+ public function getAdminPagesEdit($moduleDirname, $table, $language, $fpif)
{
- $stuTableName = strtoupper($tableName);
+ $tableName = $table->getVar('table_name');
+ $tableSoleName = $table->getVar('table_solename');
+ $tableFieldname = $table->getVar('table_fieldname');
+ $stuTableName = strtoupper($tableName);
+ $stuTableSoleName = strtoupper($tableSoleName);
$stuTableFieldname = strtoupper($tableFieldname);
$ret = <<<EOT
case 'edit':
\$template_main = '{$moduleDirname}_admin_{$tableName}.tpl';
- \$adminMenu->addItemButton({$language}ADD_{$stuTableFieldname}, '{$tableName}.php?op=new', 'add');
+ \$adminMenu->addItemButton({$language}ADD_{$stuTableSoleName}, '{$tableName}.php?op=new', 'add');
\$adminMenu->addItemButton({$language}{$stuTableName}_LIST, '{$tableName}.php', 'list');
\$GLOBALS['xoopsTpl']->assign('navigation', \$adminMenu->addNavigation('{$tableName}.php'));
\$GLOBALS['xoopsTpl']->assign('buttons', \$adminMenu->renderButton());
@@ -341,7 +352,8 @@
\$GLOBALS['xoopsTpl']->assign('form', \$form->render());
break;\n
EOT;
- return $ret;
+
+ return $ret;
}
/*
@@ -400,7 +412,8 @@
echo \${$tableName}Obj->getHtmlErrors();
break;\n
EOT;
- return $ret;
+
+ return $ret;
}
/*
@@ -416,7 +429,8 @@
}
include __DIR__ . '/footer.php';
EOT;
- return $ret;
+
+ return $ret;
}
/*
@@ -432,8 +446,7 @@
$module = $this->getModule();
$table = $this->getTable();
$moduleDirname = $module->getVar('mod_dirname');
- $tableName = $table->getVar('table_name');
- $tableFieldname = $table->getVar('table_fieldname');
+ $tableName = $table->getVar('table_name');
$language = $this->tdmcfile->getLanguage($moduleDirname, 'AM');
$fields = $this->tdmcfile->getTableFields($table->getVar('table_id'));
foreach (array_keys($fields) as $f) {
@@ -448,11 +461,11 @@
}
$content = $this->getHeaderFilesComments($module, $filename);
$content .= $this->getAdminPagesHeader($moduleDirname, $tableName, $fpif);
- $content .= $this->getAdminPagesList($moduleDirname, $table, $tableFieldname, $language, $fields, $fpif, $fieldInForm, $fpmf);
+ $content .= $this->getAdminPagesList($moduleDirname, $table, $language, $fields, $fpif, $fieldInForm, $fpmf);
if (1 == $fieldInForm) {
$content .= $this->getAdminPagesNew($moduleDirname, $tableName, $language);
$content .= $this->getAdminPagesSave($moduleDirname, $tableName, $language, $fields, $fpif, $fpmf);
- $content .= $this->getAdminPagesEdit($moduleDirname, $tableName, $tableFieldname, $language, $fpif);
+ $content .= $this->getAdminPagesEdit($moduleDirname, $table, $language, $fpif);
}
$content .= $this->getAdminPagesDelete($tableName, $language, $fpif, $fpmf);
$content .= $this->getAdminPagesFooter();
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminPermissions.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminPermissions.php 2015-05-03 07:22:23 UTC (rev 13053)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminPermissions.php 2015-05-03 12:51:24 UTC (rev 13054)
@@ -140,9 +140,7 @@
\$formTitle = {$language}GLOBAL;
\$permName = '{$moduleDirname}_ac';
\$permDesc = {$language}GLOBAL_DESC;
- \$globalPerms = array( '4' => {$language}GLOBAL_4,
- '8' => {$language}GLOBAL_8,
- '16' => {$language}GLOBAL_16 );
+ \$globalPerms = array( '4' => {$language}GLOBAL_4, '8' => {$language}GLOBAL_8, '16' => {$language}GLOBAL_16 );
break;
case 2:
\$formTitle = {$language}APPROVE;
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/classes/ClassFiles.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/classes/ClassFiles.php 2015-05-03 07:22:23 UTC (rev 13053)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/classes/ClassFiles.php 2015-05-03 12:51:24 UTC (rev 13054)
@@ -233,8 +233,9 @@
{
$moduleDirname = $module->getVar('mod_dirname');
$tableName = $table->getVar('table_name');
+ $tableSoleName = $table->getVar('table_solename');
$ucfTableName = ucfirst($tableName);
- $stuTableName = strtoupper($tableName);
+ $stuTableSoleName = strtoupper($tableSoleName);
$language = $this->getLanguage($moduleDirname, 'AM');
$this->formelements->initForm($module, $table);
$ret = <<<EOT
@@ -249,7 +250,7 @@
\$action = \$_SERVER['REQUEST_URI'];
}
// Title
- \$title = \$this->isNew() ? sprintf({$language}{$stuTableName}_ADD) : sprintf({$language}{$stuTableName}_EDIT);
+ \$title = \$this->isNew() ? sprintf({$language}{$stuTableSoleName}_ADD) : sprintf({$language}{$stuTableSoleName}_EDIT);
// Get Theme Form
xoops_load('XoopsFormLoader');
\$form = new XoopsThemeForm(\$title, 'form', \$action, 'post', true);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/classes/ClassFormElements.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/classes/ClassFormElements.php 2015-05-03 07:22:23 UTC (rev 13053)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/classes/ClassFormElements.php 2015-05-03 12:51:24 UTC (rev 13054)
@@ -36,6 +36,7 @@
{
parent::__construct();
$this->tdmcreate = TDMCreateHelper::getInstance();
+ $this->tdmcfile = TDMCreateFile::getInstance();
}
/*
@@ -590,6 +591,7 @@
$table = $this->getTable();
$moduleDirname = $module->getVar('mod_dirname');
$tableName = $table->getVar('table_name');
+ $tableSoleName = $table->getVar('table_solename');
$language_funct = $this->getLanguage($moduleDirname, 'AM');
//$language_table = $language_funct . strtoupper($tableName);
$ret = '';
@@ -609,7 +611,8 @@
if (1 == $fields[$f]->getVar('field_main')) {
$fieldMain = $fieldName;
}
- $language = $language_funct . strtoupper($fieldName);
+ $rpFieldName = $this->tdmcfile->getRightString($fieldName);
+ $language = $language_funct . strtoupper($tableSoleName) . '_' . strtoupper($rpFieldName);
$required = (1 == $fields[$f]->getVar('field_required')) ? ', true' : '';
//
if (1 == $fieldInForm) {
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/include/IncludeInstall.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/include/IncludeInstall.php 2015-05-03 07:22:23 UTC (rev 13053)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/include/IncludeInstall.php 2015-05-03 12:51:24 UTC (rev 13054)
@@ -253,14 +253,17 @@
$fieldElement = $fields[$f]->getVar('field_element');
// All fields elements selected
switch ($fieldElement) {
- case 11:
+ case 10:
+ case 13:
$content .= $this->getInstallImagesFolder($moduleDirname);
foreach (array_keys($tables) as $t) {
$tableName = $tables[$t]->getVar('table_name');
$content .= $this->getInstallTableImagesFolder($tableName);
}
break;
- case 12:
+ case 11:
+ case 12:
+ case 14:
$content .= $this->getInstallFilesFolder($moduleDirname);
foreach (array_keys($tables) as $t) {
$tableName = $tables[$t]->getVar('table_name');
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/language/LanguageAdmin.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/language/LanguageAdmin.php 2015-05-03 07:22:23 UTC (rev 13053)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/language/LanguageAdmin.php 2015-05-03 12:51:24 UTC (rev 13054)
@@ -123,10 +123,10 @@
//
foreach (array_keys($tables) as $t) {
$tableName = $tables[$t]->getVar('table_name');
- $tableFieldname = $tables[$t]->getVar('table_fieldname');
- $stuTableFieldname = strtoupper($tableFieldname);
- $ucfTableFieldname = ucfirst($tableFieldname);
- $ret .= $this->defines->getDefine($language, "ADD_{$stuTableFieldname}", "Add {$ucfTableFieldname}");
+ $tableSoleName = $tables[$t]->getVar('table_solename');
+ $stuTableSoleName = strtoupper($tableSoleName);
+ $ucfTableSoleName = ucfirst($tableSoleName);
+ $ret .= $this->defines->getDefine($language, "ADD_{$stuTableSoleName}", "Add New {$ucfTableSoleName}");
}
$ret .= $this->defines->getAboveDefines('Lists');
//
@@ -152,28 +152,40 @@
$ret = $this->defines->getAboveHeadDefines('Admin Classes');
//
foreach (array_keys($tables) as $t) {
- $tableId = $tables[$t]->getVar('table_id');
- $tableName = $tables[$t]->getVar('table_name');
- $stuTableName = strtoupper($tableName);
- $ucfTableName = ucfirst($tableName);
- $ret .= $this->defines->getAboveDefines("{$ucfTableName} add/edit");
- $ret .= $this->defines->getDefine($language, "{$stuTableName}_ADD", "Add {$tableName}");
- $ret .= $this->defines->getDefine($language, "{$stuTableName}_EDIT", "Edit {$tableName}");
- $ret .= $this->defines->getAboveDefines("Elements of {$ucfTableName}");
+ $tableId = $tables[$t]->getVar('table_id');
+ $tableName = $tables[$t]->getVar('table_name');
+ $tableSoleName = $tables[$t]->getVar('table_solename');
+ $ucfTableSoleName = ucfirst($tableSoleName);
//
- $fields = $this->getTableFields($tableId);
+ $fields = $this->getTableFields($tableId);
+ foreach (array_keys($fields) as $f) {
+ $fieldInForm = $fields[$f]->getVar('field_inform');
+ }
+ if(1 == $fieldInForm) {
+ $ret .= $this->defines->getAboveDefines("{$ucfTableSoleName} add/edit");
+ $ret .= $this->defines->getDefine($language, "{$tableSoleName}_ADD", "Add {$ucfTableSoleName}");
+ $ret .= $this->defines->getDefine($language, "{$tableSoleName}_EDIT", "Edit {$ucfTableSoleName}");
+ }
+ $ret .= $this->defines->getAboveDefines("Elements of {$ucfTableSoleName}");
+ //
foreach (array_keys($fields) as $f) {
$fieldName = $fields[$f]->getVar('field_name');
$fieldElement = $fields[$f]->getVar('field_element');
$stuFieldName = strtoupper($fieldName);
//
$rpFieldName = $this->tdmcfile->getRightString($fieldName);
- $lpFieldName = substr($fieldName, 0, strpos($fieldName, '_'));
+ if ($fieldElement > 15) {
+ $fieldElements = $this->tdmcreate->getHandler('fieldelements')->get($fieldElement);
+ $fieldElementTid = $fieldElements->getVar('fieldelement_tid');
+ $fieldElementName = $fieldElements->getVar('fieldelement_name');
+ $fieldNameDesc = substr($fieldElementName, strrpos($fieldElementName, ':'), strlen($fieldElementName));
+ $fieldNameDesc = str_replace(': ', '', $fieldNameDesc);
+ } else {
+ $fieldNameDesc = ucfirst($rpFieldName);
+ }
//
- $fieldNameDesc = ucfirst($rpFieldName);
+ $ret .= $this->defines->getDefine($language, $tableSoleName .'_'. $rpFieldName, $fieldNameDesc);
//
- $ret .= $this->defines->getDefine($language, $stuFieldName, $fieldNameDesc);
- //
switch ($fieldElement) {
case 10:
$ret .= $this->defines->getDefine($language, "FORM_UPLOAD_IMAGE_LIST_{$stuTableName}", "{$fieldNameDesc} in frameworks images");
@@ -253,7 +265,6 @@
public function render()
{
$module = $this->getModule();
- $table = $this->getTable();
$tables = $this->getTables();
$filename = $this->getFileName();
$moduleDirname = $module->getVar('mod_dirname');
@@ -263,9 +274,7 @@
$content .= $this->getLanguageAdminIndex($language, $tables);
$content .= $this->getLanguageAdminPages($language, $tables);
$content .= $this->getLanguageAdminClass($language, $tables);
- if (1 == $table->getVar('table_permissions')) {
- $content .= $this->getLanguageAdminPermissions($language);
- }
+ $content .= $this->getLanguageAdminPermissions($language);
}
$content .= $this->getLanguageAdminFoot($language);
//
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/language/LanguageDefines.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/language/LanguageDefines.php 2015-05-03 07:22:23 UTC (rev 13053)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/language/LanguageDefines.php 2015-05-03 12:51:24 UTC (rev 13054)
@@ -87,7 +87,8 @@
*/
public function getDefine($language, $defined, $description)
{
- $ret = <<<EOT
+ $defined = strtoupper($defined);
+ $ret = <<<EOT
define('{$language}{$defined}', "{$description}");\n
EOT;
return $ret;
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/sql/SqlFile.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/sql/SqlFile.php 2015-05-03 07:22:23 UTC (rev 13053)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/sql/SqlFile.php 2015-05-03 12:51:24 UTC (rev 13054)
@@ -57,10 +57,10 @@
/*
* @public function write
- * @param string $module
- * @param string $table
- * @param string $tables
- * @param string $filename
+ * @param $module
+ * @param $table
+ * @param $tables
+ * @param $filename
*/
/**
* @param $module
@@ -76,7 +76,7 @@
/*
* @private function getHeaderSqlComments
- * @param string $moduleName
+ * @param $moduleName
*/
/**
* @param $moduleName
@@ -105,8 +105,8 @@
/*
* @private function getHeadDatabaseTable
- * @param string $moduleDirname
- * @param string $tableName
+ * @param $moduleDirname
+ * @param $tableName
* @param integer $fieldsNumb
*
* Unused IF NOT EXISTS
@@ -126,7 +126,7 @@
/*
* @private function getDatabaseTables
- * @param string $moduleDirname
+ * @param $moduleDirname
* @return null|string
*/
private function getDatabaseTables($moduleDirname)
@@ -146,10 +146,10 @@
/*
* @private function getDatabaseFields
- * @param string $moduleDirname
- * @param string $tableName
- * @param integer $tableAutoincrement
- * @param integer $fieldsNumb
+ * @param $moduleDirname
+ * @param $tableName
+ * @param $tableAutoincrement
+ * @param $fieldsNumb
* @return null|string
*/
private function getDatabaseFields($moduleDirname, $tableId, $tableName, $tableAutoincrement, $fieldsNumb)
@@ -276,12 +276,12 @@
/*
* @private function getFieldRow
- * @param string $fieldName
- * @param string $fieldTypeValue
- * @param string $fieldAttribute
- * @param string $fieldNull
- * @param string $fieldDefault
- * @param string $autoincrement
+ * @param $fieldName
+ * @param $fieldTypeValue
+ * @param $fieldAttribute
+ * @param $fieldNull
+ * @param $fieldDefault
+ * @param $autoincrement
* @return string
*/
private function getFieldRow($fieldName, $fieldTypeValue, $fieldAttribute = null, $fieldNull = null, $fieldDefault = null, $autoincrement = null)
@@ -349,8 +349,8 @@
/*
* @private function getComma
- * @param array $row
- * @param string $comma
+ * @param $row
+ * @param $comma
* @return string
*/
private function getComma($row, $comma = null)
@@ -364,8 +364,8 @@
/*
* @private function getCommaCicle
- * @param array $comma
- * @param integer $index
+ * @param $comma
+ * @param $index
* @return string
*/
private function getCommaCicle($comma, $index)
@@ -394,7 +394,7 @@
$moduleName = strtolower($module->getVar('mod_name'));
$moduleDirname = strtolower($module->getVar('mod_dirname'));
$content = $this->getHeaderSqlComments($moduleName);
- $content .= $this->getDatabaseTables($moduleDirname);
+ $content .= $this->getDatabaseTables($moduleDirname);
//
$this->tdmcfile->create($moduleDirname, 'sql', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/templates/admin/TemplatesAdminPages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/templates/admin/TemplatesAdminPages.php 2015-05-03 07:22:23 UTC (rev 13053)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/templates/admin/TemplatesAdminPages.php 2015-05-03 12:51:24 UTC (rev 13054)
@@ -77,8 +77,9 @@
*/
private function getTemplatesAdminPagesHeader($moduleDirname, $table, $fields, $language)
{
- $tableName = $table->getVar('table_name');
- $ret = <<<EOT
+ $tableName = $table->getVar('table_name');
+ $tableSoleName = $table->getVar('table_solename');
+ $ret = <<<EOT
<{include file="db:{$moduleDirname}_admin_header.tpl"}>
<{if {$tableName}_list}>
<table class="outer {$tableName} width100">
@@ -86,8 +87,9 @@
<tr class="head">\n
EOT;
foreach (array_keys($fields) as $f) {
- $fieldName = $fields[$f]->getVar('field_name');
- $lang_fn = $language . strtoupper($fieldName);
+ $fieldName = $fields[$f]->getVar('field_name');
+ $rpFieldName = $this->tdmcfile->getRightString($fieldName);
+ $lang_fn = $language . strtoupper($tableSoleName) . '_' . strtoupper($rpFieldName);
if ((1 == $table->getVar('table_autoincrement')) || (1 == $fields[$f]->getVar('field_inlist'))) {
$ret .= <<<EOT
<th class="center"><{\$smarty.const.{$lang_fn}}></th>\n
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/user/UserObjects.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/user/UserObjects.php 2015-05-03 07:22:23 UTC (rev 13053)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/user/UserObjects.php 2015-05-03 12:51:24 UTC (rev 13054)
@@ -51,7 +51,7 @@
public function getUserHeader($moduleDirname, $tableName)
{
$ret = <<<EOT
-include_once 'header.php';
+include __DIR__ . '/header.php';
\$GLOBALS['xoopsOption']['template_main'] = '{$moduleDirname}_{$tableName}.tpl';
include_once XOOPS_ROOT_PATH.'/header.php';\n
EOT;
@@ -66,7 +66,7 @@
public function getUserIndex($moduleDirname)
{
$ret = <<<EOT
-include_once 'header.php';
+include __DIR__ . '/header.php';
\$GLOBALS['xoopsOption']['template_main'] = '{$moduleDirname}_index.tpl';
include_once XOOPS_ROOT_PATH.'/header.php';\n
EOT;
@@ -83,7 +83,7 @@
public function getUserFooter()
{
$ret = <<<EOT
-include_once 'footer.php';
+include __DIR__ . '/footer.php';
EOT;
return $ret;
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/user/UserXoopsVersion.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/user/UserXoopsVersion.php 2015-05-03 07:22:23 UTC (rev 13053)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/user/UserXoopsVersion.php 2015-05-03 12:51:24 UTC (rev 13054)
@@ -62,10 +62,10 @@
/*
* @public function write
- * @param string $module
+ * @param $module
* @param mixed $table
* @param mixed $tables
- * @param string $filename
+ * @param $filename
*/
/**
* @param $module
@@ -115,7 +115,7 @@
/*
* @private function getXoopsVersionHeader
- * @param string $language
+ * @param $language
*/
/**
* @param $module
@@ -211,8 +211,8 @@
/*
* @private function getXoopsVersionMySQL
- * @param string $moduleDirname
- * @param string $table
+ * @param $moduleDirname
+ * @param $table
*/
/**
* @param $moduleDirname
@@ -245,7 +245,7 @@
/*
* @private function getXoopsVersionSearch
- * @param string $moduleDirname
+ * @param $moduleDirname
*/
/**
* @param $moduleDirname
@@ -265,7 +265,7 @@
/*
* @private function getXoopsVersionComments
- * @param string $moduleDirname
+ * @param $moduleDirname
*/
/**
* @param $moduleDirname
@@ -288,7 +288,7 @@
/*
* @private function getXoopsVersionTemplatesAdmin
- * @param string $moduleDirname
+ * @param $moduleDirname
*/
/**
* @param $moduleDirname
@@ -325,7 +325,7 @@
/*
* @private function getXoopsVersionTemplatesUser
- * @param string $moduleDirname
+ * @param $modu...
[truncated message content] |
|
From: <txm...@us...> - 2015-05-04 18:50:08
|
Revision: 13057
http://sourceforge.net/p/xoops/svn/13057
Author: txmodxoops
Date: 2015-05-04 18:50:06 +0000 (Mon, 04 May 2015)
Log Message:
-----------
Deleted unnecessaries functions in classes
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/building.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateArchitecture.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateFile.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateStructure.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/user/UserSubmit.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/docs/changelog.txt
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/building.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/building.php 2015-05-04 13:07:33 UTC (rev 13056)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/building.php 2015-05-04 18:50:06 UTC (rev 13057)
@@ -43,7 +43,7 @@
}
}
// Structure
- include_once TDMC_PATH . '/class/files/TDMCreateArchitecture.php';
+ include_once TDMC_CLASSES_PATH . '/files/TDMCreateArchitecture.php';
$handler = TDMCreateArchitecture::getInstance();
// Creation of the structure of folders and files
$base_architecture = $handler->createBaseFoldersFiles($moduleObj);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateArchitecture.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateArchitecture.php 2015-05-04 13:07:33 UTC (rev 13056)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateArchitecture.php 2015-05-04 18:50:06 UTC (rev 13057)
@@ -47,7 +47,6 @@
{
$this->tdmcreate = TDMCreateHelper::getInstance();
$this->structure = TDMCreateStructure::getInstance();
- $this->structure->setPath(TDMC_PATH);
$this->structure->setUploadPath(TDMC_UPLOAD_REPOSITORY_PATH);
}
@@ -66,37 +65,9 @@
}
return $instance;
- }
+ }
/*
- * @public function createPath
- * @param string $path
- */
- /**
- * @param $path
- */
- public function createPath($path)
- {
- if (isset($path)) {
- $this->structure->setPath($path);
- }
- }
-
- /*
- * @public function createUploadPath
- * @param string $uploadPath
- */
- /**
- * @param $uploadPath
- */
- public function createUploadPath($uploadPath)
- {
- if (isset($uploadPath)) {
- $this->structure->setUploadPath($uploadPath);
- }
- }
-
- /*
* @public function createBaseFoldersFiles
* @param string $module
*/
@@ -210,15 +181,13 @@
// Creation of "templates/admin" folder and index.html file
$this->structure->makeDirAndCopyFile('templates/admin', $indexFile, 'index.html');
}
- if (is_object($table)) {
- if (1 == $table->getVar('table_blocks')) {
+ if ($table->getVar('table_name') != null) {
+ if (1 == $module->getVar('mod_blocks')) {
// Creation of "templates/blocks" folder and index.html file
$this->structure->makeDirAndCopyFile('templates/blocks', $indexFile, 'index.html');
}
- if ($table->getVar('table_name') != null) {
- // Creation of "sql" folder and index.html file
- $this->structure->makeDirAndCopyFile('sql', $indexFile, 'index.html');
- }
+ // Creation of "sql" folder and index.html file
+ $this->structure->makeDirAndCopyFile('sql', $indexFile, 'index.html');
if (1 == $table->getVar('table_notifications')) {
// Creation of "language/english/mail_template" folder and index.html file
$this->structure->makeDirAndCopyFile('language/english/mail_template', $indexFile, 'index.html');
@@ -227,7 +196,7 @@
$this->structure->makeDirAndCopyFile('language/' . $language . '/mail_template', $indexFile, 'index.html');
}
}
- }
+ }
}
/*
@@ -368,7 +337,7 @@
$includeFunctions->write($module, 'functions.php');
$ret[] = $includeFunctions->render();
// Creation of blocks language file
- if (is_object($table)) {
+ if ($table->getVar('table_name') != null) {
// Include Install File
$includeInstall = IncludeInstall::getInstance();
$includeInstall->write($module, $table, $tables, 'install.php');
@@ -445,8 +414,7 @@
$includeCommentFunctions = IncludeCommentFunctions::getInstance();
$includeCommentFunctions->write($module, $table, 'comment_functions.php');
$ret[] = $includeCommentFunctions->renderFile();
- }
-
+ }
}
// Creation of admin files
if (1 == $module->getVar('mod_admin')) {
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateFile.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateFile.php 2015-05-04 13:07:33 UTC (rev 13056)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateFile.php 2015-05-04 18:50:06 UTC (rev 13057)
@@ -139,33 +139,9 @@
if (isset($subdir) && is_string($subdir)) {
$this->setSubDir($subdir);
}
- }
+ }
/*
- * @private function setPath
- * @param string $folderName
- */
- /**
- * @param $folderName
- */
- private function setPath($folderName)
- {
- $this->path = TDMC_PATH . DIRECTORY_SEPARATOR . $folderName;
- }
-
- /*
- * @private function getPath
- * @param null
- */
- /**
- * @return string
- */
- private function getPath()
- {
- return $this->path;
- }
-
- /*
* @private function setRepositoryPath
* @param string $moduleDirname
*/
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateStructure.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateStructure.php 2015-05-04 13:07:33 UTC (rev 13056)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateStructure.php 2015-05-04 18:50:06 UTC (rev 13057)
@@ -77,33 +77,9 @@
}
return $instance;
- }
-
+ }
+
/*
- * @public function setPath
- * @param string $path
- */
- /**
- * @param $path
- */
- public function setPath($path)
- {
- $this->path = $path;
- }
-
- /*
- * @public function getPath
- * @return string $path
- */
- /**
- * @return null
- */
- public function getPath()
- {
- return $this->path;
- }
-
- /*
* @protected function setUploadPath
* @param string $path
*/
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/user/UserSubmit.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/user/UserSubmit.php 2015-05-04 13:07:33 UTC (rev 13056)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/user/UserSubmit.php 2015-05-04 18:50:06 UTC (rev 13057)
@@ -16,7 +16,7 @@
* @package tdmcreate
* @since 2.5.0
* @author Txmod Xoops http://www.txmodxoops.org
- * @version $Id: user_submit.php 12258 2014-01-02 09:33:29Z timgno $
+ * @version $Id: UserSubmit.php 12258 2014-01-02 09:33:29Z timgno $
*/
defined('XOOPS_ROOT_PATH') or die('Restricted access');
@@ -84,11 +84,11 @@
{
$ret = <<<EOT
include __DIR__ . '/header.php';
-\$op = downloads_CleanVars(\$_REQUEST, 'op', 'form', 'string');
+\$op = {$moduleDirname}_CleanVars(\$_REQUEST, 'op', 'form', 'string');
// Template
\$xoopsOption['template_main'] = '{$moduleDirname}_submit.tpl';
include_once XOOPS_ROOT_PATH.'/header.php';
-\$xoTheme->addStylesheet( XOOPS_URL . '/modules/' . \$xoopsModule->getVar('dirname', 'n') . '/css/style.css', null );
+\$xoTheme->addStylesheet( XOOPS_URL . '/modules/' . \$xoopsModule->getVar('dirname', 'n') . '/assets/css/style.css', null );
//On recupere la valeur de l'argument op dans l'URL$
// redirection if not permissions
if (\$perm_submit == false) {
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/docs/changelog.txt
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/docs/changelog.txt 2015-05-04 13:07:33 UTC (rev 13056)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/docs/changelog.txt 2015-05-04 18:50:06 UTC (rev 13057)
@@ -9,6 +9,8 @@
- Added more field database in tables form
- Added more field database in fields form
- Added checkAll checkbox in modules & tables form
+- Added more files for user side
+- Added autoload file for all classes
=================================
2014/01/02: Version 1.91 alpha 1
|
|
From: <txm...@us...> - 2015-05-19 18:10:50
|
Revision: 13064
http://sourceforge.net/p/xoops/svn/13064
Author: txmodxoops
Date: 2015-05-19 18:10:46 +0000 (Tue, 19 May 2015)
Log Message:
-----------
Added settings.php for customized module informazions
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/menu.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/modules.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/css/admin/style.css
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/fieldattributes.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/fieldelements.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/fieldkey.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/fieldnull.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/fieldtype.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateArchitecture.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateTableFields.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminFooter.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminIndex.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminObjects.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminPages.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminPermissions.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/classes/ClassFiles.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/classes/ClassFormElements.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/language/LanguageAdmin.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/templates/admin/TemplatesAdminPages.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/user/UserXoopsVersion.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/modules.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/docs/changelog.txt
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/docs/credits.txt
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/language/english/admin.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/language/english/modinfo.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/sql/mysql.sql
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/templates/admin/tdmcreate_building.tpl
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/templates/admin/tdmcreate_fields.tpl
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/templates/admin/tdmcreate_fields_item.tpl
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/templates/admin/tdmcreate_tables.tpl
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/templates/admin/tdmcreate_tables_item.tpl
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/xoops_version.php
Added Paths:
-----------
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/settings.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/icons/32/settings.png
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/cache/classpaths.cache
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/cache/
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/cache/classpaths.cache
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/cache/index.html
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/settings.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/templates/admin/tdmcreate_settings.tpl
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/fields.php 2015-05-16 05:58:18 UTC (rev 13063)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/fields.php 2015-05-19 18:10:46 UTC (rev 13064)
@@ -60,7 +60,7 @@
if ($countTables == 0) {
redirect_header('tables.php?op=new', 2, _AM_TDMCREATE_NOTTABLES );
}
- unset($countTables);
+ unset($countTables);
// Get the list of tables
$criteria = new CriteriaCompo();
$criteria->add(new Criteria('table_mid', $handlerTables->getVar('table_mid')));
@@ -160,9 +160,10 @@
if ( !$GLOBALS['xoopsSecurity']->check() ) {
redirect_header('fields.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
}
- $fieldId = XoopsRequest::getInt('field_id');
+ $fieldId = XoopsRequest::getInt('field_id');
// Fields Handler
- $fields = $tdmcreate->getHandler('fields');
+ $fields = $tdmcreate->getHandler('fields');
+ $fieldOrder = 1;
// Set Variables
foreach($_POST['field_id'] as $key => $value)
{
@@ -171,8 +172,7 @@
} else {
$fieldsObj =& $fields->create();
}
- $fieldOrder = XoopsRequest::getInt('field_order');
- $order = $fieldsObj->isNew() ? $fieldOrder++ : $fieldOrder;
+ $order = $fieldsObj->isNew() ? $fieldOrder : XoopsRequest::getInt('field_order');
// Set Data
$fieldsObj->setVar( 'field_mid', $fieldMid );
$fieldsObj->setVar( 'field_tid', $fieldTid );
@@ -196,7 +196,9 @@
$fieldsObj->setVar( 'field_required', (1 == $_REQUEST['field_required'][$key]) ? 1 : 0);
// Insert Data
$tdmcreate->getHandler('fields')->insert($fieldsObj);
+ $fieldOrder++;
}
+ unset($fieldOrder);
// Get table name from field table id
$tables =& $tdmcreate->getHandler('tables')->get($fieldTid);
$tableName = $tables->getVar('table_name');
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/menu.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/menu.php 2015-05-16 05:58:18 UTC (rev 13063)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/menu.php 2015-05-19 18:10:46 UTC (rev 13064)
@@ -29,22 +29,26 @@
$adminmenu[$i]['icon'] = $sysPathIcon32 . '/dashboard.png';
$i++;
$adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU2;
+$adminmenu[$i]['link'] = 'admin/settings.php';
+$adminmenu[$i]['icon'] = 'assets/icons/32/settings.png';
+$i++;
+$adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU3;
$adminmenu[$i]['link'] = 'admin/modules.php';
$adminmenu[$i]['icon'] = 'assets/icons/32/addmodule.png';
$i++;
-$adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU3;
+$adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU4;
$adminmenu[$i]['link'] = 'admin/tables.php';
$adminmenu[$i]['icon'] = 'assets/icons/32/addtable.png';
$i++;
-$adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU4;
+$adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU5;
$adminmenu[$i]['link'] = 'admin/fields.php';
$adminmenu[$i]['icon'] = 'assets/icons/32/fields.png';
$i++;
-$adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU5;
+$adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU6;
$adminmenu[$i]['link'] = 'admin/building.php';
$adminmenu[$i]['icon'] = 'assets/icons/32/builder.png';
$i++;
-$adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU6;
+$adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU7;
$adminmenu[$i]['link'] = 'admin/about.php';
$adminmenu[$i]['icon'] = $sysPathIcon32 . '/about.png';
unset($i);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/modules.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/modules.php 2015-05-16 05:58:18 UTC (rev 13063)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/modules.php 2015-05-19 18:10:46 UTC (rev 13064)
@@ -22,7 +22,7 @@
// Recovered value of argument op in the URL $
$op = XoopsRequest::getString('op', 'list');
//
-$mod_id = XoopsRequest::getInt('mod_id');
+$modId = XoopsRequest::getInt('mod_id');
//
switch ($op) {
case 'list':
@@ -98,8 +98,8 @@
if (!$GLOBALS['xoopsSecurity']->check()) {
redirect_header('modules.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
}
- if (isset($mod_id)) {
- $modulesObj =& $tdmcreate->getHandler('modules')->get($mod_id);
+ if (isset($modId)) {
+ $modulesObj =& $tdmcreate->getHandler('modules')->get($modId);
} else {
$modulesObj =& $tdmcreate->getHandler('modules')->create();
}
@@ -184,13 +184,13 @@
$adminMenu->addItemButton(_AM_TDMCREATE_MODULES_LIST, 'modules.php', 'list');
$GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
- $modulesObj = $tdmcreate->getHandler('modules')->get($mod_id);
+ $modulesObj = $tdmcreate->getHandler('modules')->get($modId);
$form = $modulesObj->getForm();
$GLOBALS['xoopsTpl']->assign('form', $form->render());
break;
case 'delete':
- $modulesObj =& $tdmcreate->getHandler('modules')->get($mod_id);
+ $modulesObj =& $tdmcreate->getHandler('modules')->get($modId);
if (isset($_REQUEST['ok']) && 1 == $_REQUEST['ok']) {
if (!$GLOBALS['xoopsSecurity']->check()) {
redirect_header('modules.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
@@ -201,12 +201,12 @@
$GLOBALS['xoopsTpl']->assign('error', $modulesObj->getHtmlErrors());
}
} else {
- xoops_confirm(array('ok' => 1, 'mod_id' => $mod_id, 'op' => 'delete'), $_SERVER['REQUEST_URI'], sprintf(_AM_TDMCREATE_FORMSUREDEL, $modulesObj->getVar('mod_name')));
+ xoops_confirm(array('ok' => 1, 'mod_id' => $modId, 'op' => 'delete'), $_SERVER['REQUEST_URI'], sprintf(_AM_TDMCREATE_FORMSUREDEL, $modulesObj->getVar('mod_name')));
}
break;
case 'display':
- //if ( $mod_id > 0 ) {
+ //if ( $modId > 0 ) {
$mod_admin = XoopsRequest::getInt('mod_admin');
$mod_user = XoopsRequest::getInt('mod_user');
$mod_blocks = XoopsRequest::getInt('mod_blocks');
@@ -225,7 +225,7 @@
$mod_notifications = tdmcreate_CleanVars($_REQUEST, 'mod_notifications');
$mod_permissions = tdmcreate_CleanVars($_REQUEST, 'mod_permissions'); */
- $modulesObj =& $tdmcreate->getHandler('modules')->get($mod_id);
+ $modulesObj =& $tdmcreate->getHandler('modules')->get($modId);
if (isset($mod_admin)) {
$modulesObj->setVar('mod_admin', $mod_admin);
} elseif (isset($mod_user)) {
Added: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/settings.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/settings.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/settings.php 2015-05-19 18:10:46 UTC (rev 13064)
@@ -0,0 +1,100 @@
+<?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 settings.php 11297 2013-03-24 10:58:10Z timgno $
+ */
+include __DIR__ . '/header.php';
+// Recovered value of argument op in the URL $
+$op = XoopsRequest::getString('op', 'edit');
+//
+$modId = XoopsRequest::getInt('set_id');
+//
+switch ($op) {
+ case 'edit':
+ default:
+ // Define main template
+ $template_main = 'tdmcreate_settings.tpl';
+ $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('settings.php'));
+ $settingsObj = $tdmcreate->getHandler('settings')->get($modId);
+ $form = $settingsObj->getForm();
+ $GLOBALS['xoopsTpl']->assign('form', $form->render());
+ break;
+
+ case 'save':
+ if (!$GLOBALS['xoopsSecurity']->check()) {
+ redirect_header('settings.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
+ }
+ if (isset($modId)) {
+ $settingsObj =& $tdmcreate->getHandler('settings')->get($modId);
+ }
+ $moduleDirname = preg_replace('/[^a-zA-Z0-9]\s+/', '', strtolower($_POST['set_dirname']));
+ //Form module save
+ $settingsObj->setVars(array(
+ 'set_name' => $_POST['set_name'],
+ 'set_dirname' => $moduleDirname,
+ 'set_version' => $_POST['set_version'],
+ 'set_since' => $_POST['set_since'],
+ 'set_min_php' => $_POST['set_min_php'],
+ 'set_min_xoops' => $_POST['set_min_xoops'],
+ 'set_min_admin' => $_POST['set_min_admin'],
+ 'set_min_mysql' => $_POST['set_min_mysql'],
+ 'set_description' => $_POST['set_description'],
+ 'set_author' => $_POST['set_author'],
+ 'set_author_mail' => $_POST['set_author_mail'],
+ 'set_author_website_url' => $_POST['set_author_website_url'],
+ 'set_author_website_name' => $_POST['set_author_website_name'],
+ 'set_credits' => $_POST['set_credits'],
+ 'set_license' => $_POST['set_license'],
+ 'set_release_info' => $_POST['set_release_info'],
+ 'set_release_file' => $_POST['set_release_file'],
+ 'set_manual' => $_POST['set_manual'],
+ 'set_manual_file' => $_POST['set_manual_file']));
+ //Form mod_image
+ $settingsObj->setVar('set_image', $_POST['set_image']);
+ //Form module save
+ $settingsObj->setVars(array(
+ 'set_demo_site_url' => $_POST['set_demo_site_url'],
+ 'set_demo_site_name' => $_POST['set_demo_site_name'],
+ 'set_support_url' => $_POST['set_support_url'],
+ 'set_support_name' => $_POST['set_support_name'],
+ 'set_website_url' => $_POST['set_website_url'],
+ 'set_website_name' => $_POST['set_website_name'],
+ 'set_release' => $_POST['set_release'],
+ 'set_status' => $_POST['set_status'],
+ 'set_admin' => ((1 == $_REQUEST['set_admin']) ? 1 : 0),
+ 'set_user' => ((1 == $_REQUEST['set_user']) ? 1 : 0),
+ 'set_blocks' => ((1 == $_REQUEST['set_blocks']) ? 1 : 0),
+ 'set_search' => ((1 == $_REQUEST['set_search']) ? 1 : 0),
+ 'set_comments' => ((1 == $_REQUEST['set_comments']) ? 1 : 0),
+ 'set_notifications' => ((1 == $_REQUEST['set_notifications']) ? 1 : 0),
+ 'set_permissions' => ((1 == $_REQUEST['set_permissions']) ? 1 : 0),
+ 'set_inroot_copy' => ((1 == $_REQUEST['set_inroot_copy']) ? 1 : 0),
+ 'set_donations' => $_POST['set_donations'],
+ 'set_subversion' => $_POST['set_subversion'])
+ );
+
+ if ($tdmcreate->getHandler('settings')->insert($settingsObj)) {
+ redirect_header('settings.php', 5, sprintf(_AM_TDMCREATE_MODULE_FORM_UPDATED_OK, $_POST['set_name']));
+ }
+
+ $GLOBALS['xoopsTpl']->assign('error', $settingsObj->getHtmlErrors());
+ $form =& $settingsObj->getForm();
+ $GLOBALS['xoopsTpl']->assign('form', $form->render());
+ break;
+}
+include __DIR__ . '/footer.php';
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/css/admin/style.css
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/css/admin/style.css 2015-05-16 05:58:18 UTC (rev 13063)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/css/admin/style.css 2015-05-19 18:10:46 UTC (rev 13064)
@@ -50,6 +50,10 @@
vertical-align: middle;
}
+tr.modules td.name {
+ min-width: 70px;
+}
+
tr.tables td {
/* display: block; Problems in FireFox and Opera */
margin: 0;
@@ -59,15 +63,36 @@
vertical-align: middle;
}
+tr.tables td.name {
+ min-width: 70px;
+}
+
+tr.tables-fields td {
+ /* display: block; Problems in FireFox and Opera */
+ margin: 0;
+ padding: 5px;
+ border-bottom: 1px solid #ccc;
+ background-color:rgba(230,130,100,0.3);
+ vertical-align: middle;
+}
+
+tr.tables-fields td.name {
+ min-width: 70px;
+}
+
tr.fields td {
/* display: block; Problems in FireFox and Opera */
margin: 0;
padding: 5px;
border-bottom: 1px solid #ccc;
- background-color:rgba(0,255,0,0.3);
+ background-color:rgba(10,215,10,0.3);
vertical-align: middle;
}
+tr.fields td.name {
+ min-width: 80px;
+}
+
/*#show_rows { margin: 0; padding: 0; width: 60%; }
#sortable tr { margin: 0 3px 3px 3px; padding: 0.4em; padding-left: 1.5em; font-size: 1.1em; height: 16px; }*/
@@ -170,7 +195,7 @@
}
.cell.cell-width3 {
- width: 8%;
+ width: 9%;
}
.cell.cell-width4 {
@@ -217,13 +242,8 @@
.field-list tr td {
padding: 5px 2px;
- margin-bottom: 3px;
- /* background-color: #efefef;
- background-image: -moz-linear-gradient(top, #efefef, #e1e1e1);
- background-image: -webkit-gradient(linear, left top,left bottom, from(#efefef), to(#e1e1e1));
- background-image: linear-gradient(top, #efefef, #e1e1e1);
- filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, StartColorStr=#efefef, EndColorStr=#e1e1e1); vale solo per IE */
- text-shadow:1px 1px 0 #fff;
+ margin-bottom: 3px;
+ text-shadow: 1px 1px 1px #fff;
color:#ff8400;
}
Added: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/icons/32/settings.png
===================================================================
(Binary files differ)
Index: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/icons/32/settings.png
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/icons/32/settings.png 2015-05-16 05:58:18 UTC (rev 13063)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/icons/32/settings.png 2015-05-19 18:10:46 UTC (rev 13064)
Property changes on: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/icons/32/settings.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/cache/classpaths.cache
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/cache/classpaths.cache (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/cache/classpaths.cache 2015-05-19 18:10:46 UTC (rev 13064)
@@ -0,0 +1 @@
+a:5:{s:18:"TDMCreateStructure";s:101:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\TDMCreateStructure.php";s:10:"AdminPages";s:99:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\admin\AdminPages.php";s:18:"TDMCreateThemeForm";s:100:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\form\TDMCreateThemeForm.php";s:18:"TDMCreateFormLabel";s:100:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\html\TDMCreateFormLabel.php";s:18:"TDMCreateFormRadio";s:100:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\form\TDMCreateFormRadio.php";}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/fieldattributes.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/fieldattributes.php 2015-05-16 05:58:18 UTC (rev 13063)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/fieldattributes.php 2015-05-19 18:10:46 UTC (rev 13064)
@@ -39,7 +39,6 @@
*/
public function __construct()
{
- $this->XoopsObject();
$this->initVar('fieldattribute_id', XOBJ_DTYPE_INT);
$this->initVar('fieldattribute_name', XOBJ_DTYPE_TXTBOX);
$this->initVar('fieldattribute_value', XOBJ_DTYPE_TXTBOX);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/fieldelements.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/fieldelements.php 2015-05-16 05:58:18 UTC (rev 13063)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/fieldelements.php 2015-05-19 18:10:46 UTC (rev 13064)
@@ -39,7 +39,6 @@
*/
public function __construct()
{
- $this->XoopsObject();
$this->initVar('fieldelement_id', XOBJ_DTYPE_INT);
$this->initVar('fieldelement_mid', XOBJ_DTYPE_INT);
$this->initVar('fieldelement_tid', XOBJ_DTYPE_INT);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/fieldkey.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/fieldkey.php 2015-05-16 05:58:18 UTC (rev 13063)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/fieldkey.php 2015-05-19 18:10:46 UTC (rev 13064)
@@ -39,7 +39,6 @@
*/
public function __construct()
{
- $this->XoopsObject();
$this->initVar('fieldkey_id', XOBJ_DTYPE_INT);
$this->initVar('fieldkey_name', XOBJ_DTYPE_TXTBOX);
$this->initVar('fieldkey_value', XOBJ_DTYPE_TXTBOX);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/fieldnull.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/fieldnull.php 2015-05-16 05:58:18 UTC (rev 13063)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/fieldnull.php 2015-05-19 18:10:46 UTC (rev 13064)
@@ -39,7 +39,6 @@
*/
public function __construct()
{
- $this->XoopsObject();
$this->initVar('fieldnull_id', XOBJ_DTYPE_INT);
$this->initVar('fieldnull_name', XOBJ_DTYPE_TXTBOX);
$this->initVar('fieldnull_value', XOBJ_DTYPE_TXTBOX);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/fieldtype.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/fieldtype.php 2015-05-16 05:58:18 UTC (rev 13063)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/fieldtype.php 2015-05-19 18:10:46 UTC (rev 13064)
@@ -39,7 +39,6 @@
*/
public function __construct()
{
- $this->XoopsObject();
$this->initVar('fieldtype_id', XOBJ_DTYPE_INT);
$this->initVar('fieldtype_name', XOBJ_DTYPE_TXTBOX);
$this->initVar('fieldtype_value', XOBJ_DTYPE_TXTBOX);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateArchitecture.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateArchitecture.php 2015-05-16 05:58:18 UTC (rev 13063)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateArchitecture.php 2015-05-19 18:10:46 UTC (rev 13064)
@@ -80,10 +80,10 @@
$modId = $module->getVar('mod_id');
$language = $GLOBALS['xoopsConfig']['language'];
// Id of tables
- $criteriaTables = new CriteriaCompo();
- $criteriaTables->add(new Criteria('table_mid', $modId));
- $tables = $this->tdmcreate->getHandler('tables')->getObjects($criteriaTables);
- unset($criteriaTables);
+ $criteria = new CriteriaCompo();
+ $criteria->add(new Criteria('table_mid', $modId));
+ $tables = $this->tdmcreate->getHandler('tables')->getObjects($criteria);
+ unset($criteria);
//
$table = null;
foreach (array_keys($tables) as $t) {
@@ -214,10 +214,11 @@
$moduleDirname = $module->getVar('mod_dirname');
$icon32 = 'assets/icons/32';
// Id of tables
- $criteriaTables = new CriteriaCompo();
- $criteriaTables->add(new Criteria('table_mid', $modId));
- $tables = $this->tdmcreate->getHandler('tables')->getObjects($criteriaTables);
- unset($criteriaTables);
+ $criteria = new CriteriaCompo();
+ $criteria->add(new Criteria('table_mid', $modId));
+ $criteria->setSort('table_order');
+ $tables = $this->tdmcreate->getHandler('tables')->getObjects($criteria);
+ unset($criteria);
$ret = array();
//
$table = array();
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateTableFields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateTableFields.php 2015-05-16 05:58:18 UTC (rev 13063)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateTableFields.php 2015-05-19 18:10:46 UTC (rev 13064)
@@ -42,6 +42,7 @@
{
$criteria = new CriteriaCompo();
$criteria->add(new Criteria('field_tid', $tableId));
+ $criteria->setSort('field_order');
$fields = $this->tdmcreate->getHandler('fields')->getObjects($criteria);
unset($criteria);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminFooter.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminFooter.php 2015-05-16 05:58:18 UTC (rev 13063)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminFooter.php 2015-05-19 18:10:46 UTC (rev 13064)
@@ -85,7 +85,7 @@
$content = $this->getHeaderFilesComments($module, $filename);
$content .= <<<EOT
if ( isset(\$template_main) ) {
- \$GLOBALS['xoopsTpl']->display("db:{\$template_main}");
+ \$GLOBALS['xoopsTpl']->display("db:{\$templateMain}");
}
xoops_cp_footer();
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminIndex.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminIndex.php 2015-05-16 05:58:18 UTC (rev 13063)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminIndex.php 2015-05-19 18:10:46 UTC (rev 13064)
@@ -86,7 +86,7 @@
$filename = $this->getFileName();
$moduleDirname = $module->getVar('mod_dirname');
$language = $this->getLanguage($moduleDirname, 'AM');
- $language_thereare = $this->getLanguage($moduleDirname, 'AM', 'THEREARE_');
+ $languageThereAre = $this->getLanguage($moduleDirname, 'AM', 'THEREARE_');
$content = $this->getHeaderFilesComments($module, $filename);
$content .= <<<EOT
include __DIR__ . '/header.php';
@@ -96,15 +96,16 @@
if (is_array($tables)) {
foreach (array_keys($tables) as $i) {
$tableName = $tables[$i]->getVar('table_name');
+ $ucfTableName = ucfirst($tableName);
$content .= <<<EOT
//\${$tableName}Handler =& \${$moduleDirname}->getHandler('{$tableName}');
-\$count_{$tableName} = \${$tableName}Handler->getCount();\n
+\$count{$ucfTableName} = \${$tableName}Handler->getCount();\n
EOT;
}
}
$content .= <<<EOT
// Template Index
-\$template_main = '{$moduleDirname}_admin_index.tpl';\n
+\$templateMain = '{$moduleDirname}_admin_index.tpl';\n
EOT;
if (is_array($tables)) {
$content .= <<<EOT
@@ -114,9 +115,9 @@
EOT;
foreach (array_keys($tables) as $i) {
$tableName = $tables[$i]->getVar('table_name');
- $stuTableName = $language_thereare . strtoupper($tableName);
+ $stuTableName = $languageThereAre . strtoupper($tableName);
$content .= <<<EOT
-\$adminMenu->addInfoBoxLine({$language}STATISTICS, '<label>'.{$stuTableName}.'</label>', \$count_{$tableName});\n
+\$adminMenu->addInfoBoxLine({$language}STATISTICS, '<label>'.{$stuTableName}.'</label>', \$count{$ucfTableName});\n
EOT;
}
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminObj...
[truncated message content] |
|
From: <txm...@us...> - 2015-05-24 17:27:09
|
Revision: 13066
http://sourceforge.net/p/xoops/svn/13066
Author: txmodxoops
Date: 2015-05-24 17:27:05 +0000 (Sun, 24 May 2015)
Log Message:
-----------
Fixed bugs!
Continue test with Codeception
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/building.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/footer.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/index.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/modules.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/settings.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/css/admin/style.css
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateArchitecture.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateAutoload.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateFile.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateTableFields.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminAbout.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminFooter.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminObjects.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminPages.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminPermissions.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/blocks/BlocksFiles.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/cache/classpaths.cache
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/classes/ClassFiles.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/classes/ClassFormElements.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/include/IncludeComments.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/include/IncludeInstall.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/include/IncludeNotifications.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/include/IncludeSearch.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/language/LanguageAdmin.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/language/LanguageBlocks.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/language/LanguageMain.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/sql/SqlFile.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/templates/admin/TemplatesAdminPages.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/templates/admin/TemplatesAdminPermissions.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/templates/blocks/TemplatesBlocks.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/templates/user/TemplatesUserPages.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/user/UserBroken.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/user/UserObjects.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/user/UserPages.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/user/UserPdf.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/user/UserPrint.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/user/UserRate.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/user/UserRss.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/user/UserSingle.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/user/UserSubmit.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/user/UserViewTag.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/user/UserVisit.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/user/UserXoopsVersion.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/settings.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/sql/mysql.sql
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/templates/admin/tdmcreate_fields_item.tpl
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/templates/admin/tdmcreate_modules.tpl
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/templates/admin/tdmcreate_tables_item.tpl
Added Paths:
-----------
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/templates/user/TemplatesUserBroken.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/templates/user/TemplatesUserPdf.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/templates/user/TemplatesUserPrint.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/templates/user/TemplatesUserRate.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/templates/user/TemplatesUserRss.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/templates/user/TemplatesUserSearch.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/templates/user/TemplatesUserSingle.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/templates/user/TemplatesUserSubmit.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/user/UserSearch.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/building.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/building.php 2015-05-23 04:29:24 UTC (rev 13065)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/building.php 2015-05-24 17:27:05 UTC (rev 13066)
@@ -22,10 +22,17 @@
$op = XoopsRequest::getString('op', 'default');
$mid = XoopsRequest::getInt('mod_id');
$moduleObj = $tdmcreate->getHandler('modules')->get($mid);
+// Clear cache
+$cacheFile1 = TDMC_CLASSES_PATH . '/cache/classpaths.cache';
+$cacheFile2 = TDMC_CLASSES_PATH . '/files/cache/classpaths.cache';
+if (file_exists($cacheFile1) && file_exists($cacheFile2)) {
+ unlink($cacheFile1);
+ unlink($cacheFile2);
+}
// Switch option
switch ($op) {
case 'build':
- $template_main = 'tdmcreate_building.tpl';
+ $templateMain = 'tdmcreate_building.tpl';
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('building.php'));
// Get var module dirname
$moduleDirname = $moduleObj->getVar('mod_dirname');
@@ -72,7 +79,7 @@
case 'default':
default:
- $template_main = 'tdmcreate_building.tpl';
+ $templateMain = 'tdmcreate_building.tpl';
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('building.php'));
// Redirect if there aren't modules
$nbModules = $tdmcreate->getHandler('modules')->getCount();
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/fields.php 2015-05-23 04:29:24 UTC (rev 13065)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/fields.php 2015-05-24 17:27:05 UTC (rev 13066)
@@ -34,7 +34,7 @@
$start = XoopsRequest::getInt('start', 0);
$limit = XoopsRequest::getInt('limit', $tdmcreate->getConfig('tables_adminpager'));
// Define main template
- $template_main = 'tdmcreate_fields.tpl';
+ $templateMain = 'tdmcreate_fields.tpl';
$GLOBALS['xoTheme']->addStylesheet( 'modules/tdmcreate/assets/css/admin/style.css' );
$GLOBALS['xoTheme']->addScript('browse.php?Frameworks/jquery/plugins/jquery.ui.js');
$GLOBALS['xoTheme']->addScript('modules/tdmcreate/assets/js/functions.js');
@@ -143,7 +143,7 @@
case 'new':
// Define main template
- $template_main = 'tdmcreate_fields.tpl';
+ $templateMain = 'tdmcreate_fields.tpl';
$GLOBALS['xoTheme']->addStylesheet( 'modules/tdmcreate/assets/css/admin/style.css' );
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('fields.php'));
$adminMenu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php', 'list');
@@ -227,7 +227,7 @@
case 'edit':
// Define main template
- $template_main = 'tdmcreate_fields.tpl';
+ $templateMain = 'tdmcreate_fields.tpl';
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('fields.php'));
$adminMenu->addItemButton(_AM_TDMCREATE_ADD_TABLE, 'tables.php?op=new', 'add');
$adminMenu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php', 'list');
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/footer.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/footer.php 2015-05-23 04:29:24 UTC (rev 13065)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/footer.php 2015-05-24 17:27:05 UTC (rev 13066)
@@ -19,7 +19,7 @@
* @version $Id: footer.php 12207 2013-10-23 02:46:52Z beckmi $
*/
$GLOBALS['xoopsTpl']->assign('module_name', $GLOBALS['xoopsModule']->getVar('name'));
-if (isset($template_main)) {
- $GLOBALS['xoopsTpl']->display("db:{$template_main}");
+if (isset($templateMain)) {
+ $GLOBALS['xoopsTpl']->display("db:{$templateMain}");
}
xoops_cp_footer();
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/index.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/index.php 2015-05-23 04:29:24 UTC (rev 13065)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/index.php 2015-05-24 17:27:05 UTC (rev 13066)
@@ -24,7 +24,7 @@
$count_tables = $tdmcreate->getHandler('tables')->getCount($criteria);
$count_fields = $tdmcreate->getHandler('fields')->getCount($criteria);
unset($criteria);
-$template_main = 'tdmcreate_index.tpl';
+$templateMain = 'tdmcreate_index.tpl';
$adminMenu->addInfoBox(_AM_TDMCREATE_ADMIN_NUMMODULES);
$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, '<label>' . _AM_TDMCREATE_THEREARE_NUMMODULES . '</label>', $count_modules, 'Green');
$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, '<label>' . _AM_TDMCREATE_THEREARE_NUMTABLES . '</label>', $count_tables, 'Orange');
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/modules.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/modules.php 2015-05-23 04:29:24 UTC (rev 13065)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/modules.php 2015-05-24 17:27:05 UTC (rev 13066)
@@ -30,7 +30,7 @@
$start = XoopsRequest::getInt('start', 0);
$limit = XoopsRequest::getInt('limit', $tdmcreate->getConfig('modules_adminpager'));
// Define main template
- $template_main = 'tdmcreate_modules.tpl';
+ $templateMain = 'tdmcreate_modules.tpl';
$GLOBALS['xoTheme']->addScript('modules/tdmcreate/assets/js/functions.js');
$GLOBALS['xoTheme']->addStylesheet('modules/tdmcreate/assets/css/admin/style.css');
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('modules.php'));
@@ -83,7 +83,7 @@
case 'new':
// Define main template
- $template_main = 'tdmcreate_modules.tpl';
+ $templateMain = 'tdmcreate_modules.tpl';
$GLOBALS['xoTheme']->addScript('modules/tdmcreate/assets/js/functions.js');
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('modules.php'));
$adminMenu->addItemButton(_AM_TDMCREATE_MODULES_LIST, 'modules.php', 'list');
@@ -177,7 +177,7 @@
case 'edit':
// Define main template
- $template_main = 'tdmcreate_modules.tpl';
+ $templateMain = 'tdmcreate_modules.tpl';
$GLOBALS['xoTheme']->addScript('modules/tdmcreate/assets/js/functions.js');
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('modules.php'));
$adminMenu->addItemButton(_AM_TDMCREATE_ADD_MODULE, 'modules.php?op=new', 'add');
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/settings.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/settings.php 2015-05-23 04:29:24 UTC (rev 13065)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/settings.php 2015-05-24 17:27:05 UTC (rev 13066)
@@ -22,16 +22,16 @@
// Recovered value of argument op in the URL $
$op = XoopsRequest::getString('op', 'edit');
//
-$modId = XoopsRequest::getInt('set_id');
+$setId = XoopsRequest::getInt('set_id');
//
switch ($op) {
case 'edit':
default:
// Define main template
- $template_main = 'tdmcreate_settings.tpl';
+ $templateMain = 'tdmcreate_settings.tpl';
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('settings.php'));
- $settingsObj = $tdmcreate->getHandler('settings')->get($modId);
- $form = $settingsObj->getForm();
+ $settingsObj = $tdmcreate->getHandler('settings')->get($setId);
+ $form = $settingsObj->getForm();
$GLOBALS['xoopsTpl']->assign('form', $form->render());
break;
@@ -39,8 +39,8 @@
if (!$GLOBALS['xoopsSecurity']->check()) {
redirect_header('settings.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
}
- if (isset($modId)) {
- $settingsObj =& $tdmcreate->getHandler('settings')->get($modId);
+ if (isset($setId)) {
+ $settingsObj =& $tdmcreate->getHandler('settings')->get($setId);
}
$moduleDirname = preg_replace('/[^a-zA-Z0-9]\s+/', '', strtolower($_POST['set_dirname']));
//Form module save
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/tables.php 2015-05-23 04:29:24 UTC (rev 13065)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/tables.php 2015-05-24 17:27:05 UTC (rev 13066)
@@ -36,7 +36,7 @@
$start = XoopsRequest::getInt('start', 0);
$limit = XoopsRequest::getInt('limit', $tdmcreate->getConfig('modules_adminpager'));
// Define main template
- $template_main = 'tdmcreate_tables.tpl';
+ $templateMain = 'tdmcreate_tables.tpl';
$GLOBALS['xoTheme']->addStylesheet('modules/tdmcreate/assets/css/admin/style.css');
$GLOBALS['xoTheme']->addScript('browse.php?Frameworks/jquery/plugins/jquery.ui.js');
$GLOBALS['xoTheme']->addScript('modules/tdmcreate/assets/js/functions.js');
@@ -132,7 +132,7 @@
case 'new':
// Define main template
- $template_main = 'tdmcreate_tables.tpl';
+ $templateMain = 'tdmcreate_tables.tpl';
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('tables.php'));
$adminMenu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php', 'list');
$GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
@@ -230,7 +230,7 @@
case 'edit':
// Define main template
- $template_main = 'tdmcreate_tables.tpl';
+ $templateMain = 'tdmcreate_tables.tpl';
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('tables.php'));
$adminMenu->addItemButton(_AM_TDMCREATE_ADD_TABLE, 'tables.php?op=new', 'add');
$adminMenu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php?op=list', 'list');
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/css/admin/style.css
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/css/admin/style.css 2015-05-23 04:29:24 UTC (rev 13065)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/css/admin/style.css 2015-05-24 17:27:05 UTC (rev 13066)
@@ -22,8 +22,7 @@
body {
background: #fafafa;
color: #444;
- font-family: verdana, arial, tahoma, helvetica, sans-serif;
- text-shadow: 1px 1px 1px #fff;
+ font-family: verdana, arial, tahoma, helvetica, sans-serif;
}
table { margin: 0; padding: 0; width: 100%; }
@@ -52,6 +51,7 @@
tr.modules td.name {
min-width: 70px;
+ text-shadow: 1px 1px 1px #fff;
}
tr.tables td {
@@ -65,6 +65,7 @@
tr.tables td.name {
min-width: 70px;
+ text-shadow: 1px 1px 1px #fff;
}
tr.tables-fields td {
@@ -78,6 +79,7 @@
tr.tables-fields td.name {
min-width: 70px;
+ text-shadow: 1px 1px 1px #fff;
}
tr.fields td {
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/fields.php 2015-05-23 04:29:24 UTC (rev 13065)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/fields.php 2015-05-24 17:27:05 UTC (rev 13066)
@@ -19,7 +19,6 @@
* @version $Id: 1.91 fields.php 12258 2014-01-02 09:33:29Z timgno $
*/
defined('XOOPS_ROOT_PATH') or die('Restricted access');
-include __DIR__ . '/TDMCreateAutoload.php';
/*
* @Class TDMCreateFields
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateArchitecture.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateArchitecture.php 2015-05-23 04:29:24 UTC (rev 13065)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateArchitecture.php 2015-05-24 17:27:05 UTC (rev 13066)
@@ -31,6 +31,7 @@
* @var mixed
*/
private $tdmcreate;
+
/*
* @var mixed
*/
@@ -46,6 +47,7 @@
public function __construct()
{
$this->tdmcreate = TDMCreateHelper::getInstance();
+ $this->tdmcfile = TDMCreateFile::getInstance();
$this->structure = TDMCreateStructure::getInstance();
$this->structure->setUploadPath(TDMC_UPLOAD_REPOSITORY_PATH);
}
@@ -80,10 +82,7 @@
$modId = $module->getVar('mod_id');
$language = $GLOBALS['xoopsConfig']['language'];
// Id of tables
- $criteria = new CriteriaCompo();
- $criteria->add(new Criteria('table_mid', $modId));
- $tables = $this->tdmcreate->getHandler('tables')->getObjects($criteria);
- unset($criteria);
+ $tables = $this->tdmcfile->getTableTables($modId);
//
$table = null;
foreach (array_keys($tables) as $t) {
@@ -96,6 +95,8 @@
}
//
$indexFile = XOOPS_UPLOAD_PATH . '/index.html';
+ $cache1 = TDMC_CLASSES_PATH . '/cache';
+ $cache2 = TDMC_CLASSES_PATH . '/files/cache';
$stlModuleAuthor = str_replace(' ', '', strtolower($module->getVar('mod_author')));
$this->structure->setModuleName($module->getVar('mod_dirname'));
$uploadPath = $this->structure->getUploadPath();
@@ -173,6 +174,8 @@
$this->structure->makeDirAndCopyFile('language/english', $indexFile, 'index.html');
// Creation of "language/english/help" folder and index.html file
$this->structure->makeDirAndCopyFile('language/english/help', $indexFile, 'index.html');
+ // Creation of "preloads" folder and index.html file
+ $this->structure->makeDirAndCopyFile('preloads', $indexFile, 'index.html');
if (1 == $module->getVar('mod_admin')) {
// Creation of "templates" folder and index.html file
$this->structure->makeDirAndCopyFile('templates', $indexFile, 'index.html');
@@ -210,16 +213,11 @@
public function createFilesToBuilding($module)
{
// Module
- $modId = $module->getVar('mod_id');
- $moduleDirname = $module->getVar('mod_dirname');
- $icon32 = 'assets/icons/32';
- // Id of tables
- $criteria = new CriteriaCompo();
- $criteria->add(new Criteria('table_mid', $modId));
- $criteria->setSort('table_order');
- $tables = $this->tdmcreate->getHandler('tables')->getObjects($criteria);
- unset($criteria);
- $ret = array();
+ $modId = $module->getVar('mod_id');
+ $moduleDirname = $module->getVar('mod_dirname');
+ $icon32 = 'assets/icons/32';
+ $tables = $this->tdmcfile->getTableTables($modId);
+ $ret = array();
//
$table = array();
foreach (array_keys($tables) as $t) {
@@ -353,7 +351,7 @@
if (1 == $table->getVar('table_permissions')) {
// Admin Permissions File
$adminPermissions = AdminPermissions::getInstance();
- $adminPermissions->write($module, $tables, 'permissions.php');
+ $adminPermissions->write($module, $table, $tables, 'permissions.php');
$ret[] = $adminPermissions->render();
// Templates Admin Permissions File
$adminTemplatesPermissions = TemplatesAdminPermissions::getInstance();
@@ -448,18 +446,90 @@
$userNotificationUpdate->write($module, 'notification_update.php');
$ret[] = $userNotificationUpdate->render();
}
+ // User Broken File
+ if ((1 == $table->getVar('table_broken'))) {
+ $userBroken = UserBroken::getInstance();
+ $userBroken->write($module, $table, 'broken.php');
+ $ret[] = $userBroken->render();
+ // User Templates Broken File
+ $userTemplatesBroken = TemplatesUserBroken::getInstance();
+ $userTemplatesBroken->write($module, $table);
+ $ret[] = $userTemplatesBroken->renderFile($moduleDirname . '_broken.tpl');
+ }
+ // User Pdf File
+ if ((1 == $table->getVar('table_pdf'))) {
+ $userPdf = UserPrint::getInstance();
+ $userPdf->write($module, $table, 'pdf.php');
+ $ret[] = $userPdf->render();
+ // User Templates Pdf File
+ $userTemplatesPdf = TemplatesUserPdf::getInstance();
+ $userTemplatesPdf->write($module, $table);
+ $ret[] = $userTemplatesPdf->renderFile($moduleDirname . '_pdf.tpl');
+ }
// User Print File
if ((1 == $table->getVar('table_print'))) {
$userPrint = UserPrint::getInstance();
$userPrint->write($module, $table, 'print.php');
$ret[] = $userPrint->render();
+ // User Templates Print File
+ $userTemplatesPrint = TemplatesUserPrint::getInstance();
+ $userTemplatesPrint->write($module, $table);
+ $ret[] = $userTemplatesPrint->renderFile($moduleDirname . '_print.tpl');
}
+ // User Rate File
+ if ((1 == $table->getVar('table_rate'))) {
+ $userRate = UserRate::getInstance();
+ $userRate->write($module, $table, 'rate.php');
+ $ret[] = $userRate->render();
+ // User Templates Rate File
+ $userTemplatesRate = TemplatesUserRate::getInstance();
+ $userTemplatesRate->write($module, $table);
+ $ret[] = $userTemplatesRate->renderFile($moduleDirname . '_rate.tpl');
+ }
// User Rss File
if ((1 == $table->getVar('table_rss'))) {
$userRss = UserRss::getInstance();
$userRss->write($module, $table, 'rss.php');
$ret[] = $userRss->render();
+ // User Templates Rss File
+ $userTemplatesRss = TemplatesUserRss::getInstance();
+ $userTemplatesRss->write($module, $table);
+ $ret[] = $userTemplatesRss->renderFile($moduleDirname . '_rss.tpl');
}
+ // User Single File
+ if ((1 == $table->getVar('table_single'))) {
+ $userSingle = UserSingle::getInstance();
+ $userSingle->write($module, $table, 'single.php');
+ $ret[] = $userSingle->render();
+ // User Templates Single File
+ $userTemplatesSingle = TemplatesUserSingle::getInstance();
+ $userTemplatesSingle->write($module, $table);
+ $ret[] = $userTemplatesSingle->renderFile($moduleDirname . '_single.tpl');
+ }
+ // User Submit File
+ if ((1 == $table->getVar('table_submit'))) {
+ $userSubmit = UserSubmit::getInstance();
+ $userSubmit->write($module, $table, 'submit.php');
+ $ret[] = $userSubmit->render();
+ // User Templates Submit File
+ $userTemplatesSubmit = TemplatesUserSubmit::getInstance();
+ $userTemplatesSubmit->write($module, $table);
+ $ret[] = $userTemplatesSubmit->renderFile($moduleDirname . '_submit.tpl');
+ }// User Visit File
+ if ((1 == $table->getVar('table_visit'))) {
+ $userVisit = UserVisit::getInstance();
+ $userVisit->write($module, $table, 'visit.php');
+ $ret[] = $userVisit->render();
+ }
+ // User Tag Files
+ if ((1 == $table->getVar('table_tag'))) {
+ $userListTag = UserListTag::getInstance();
+ $userListTag->write($module, 'list.tag.php');
+ $ret[] = $userListTag->render();
+ $userViewTag = UserViewTag::getInstance();
+ $userViewTag->write($module, 'view.tag.php');
+ $ret[] = $userViewTag->render();
+ }
// User Index File
$userIndex = UserIndex::getInstance();
$userIndex->write($module, 'index.php');
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateAutoload.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateAutoload.php 2015-05-23 04:29:24 UTC (rev 13065)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateAutoload.php 2015-05-24 17:27:05 UTC (rev 13066)
@@ -50,8 +50,8 @@
}
}
- $serialized_paths = serialize($pathCache);
- if ($serialized_paths != $pathCache) { file_put_contents($cacheFile, serialize($pathCache)); }
+ $serializedPaths = serialize($pathCache);
+ if ($serializedPaths != $pathCache) { file_put_contents($cacheFile, serialize($pathCache)); }
}
spl_autoload_register('applicationAutoloader');
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateFile.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateFile.php 2015-05-23 04:29:24 UTC (rev 13065)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateFile.php 2015-05-24 17:27:05 UTC (rev 13066)
@@ -94,7 +94,8 @@
*/
public function __construct()
{
- $this->xoopsFile = XoopsFile::getHandler();
+ parent::__construct();
+ $this->xoopsFile = XoopsFile::getHandler();
$this->tdmcreate = TDMCreateHelper::getInstance();
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateTableFields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateTableFields.php 2015-05-23 04:29:24 UTC (rev 13065)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateTableFields.php 2015-05-24 17:27:05 UTC (rev 13066)
@@ -32,16 +32,34 @@
{
$this->tdmcreate = TDMCreateHelper::getInstance();
}
+
+ /**
+ * @public function getTableTables
+ * @param $mId
+ * @return mixed
+ */
+ public function getTableTables($mId)
+ {
+ $criteria = new CriteriaCompo();
+ $criteria->add(new Criteria('table_mid', $mId)); // $mId = module Id
+ $criteria->setSort('table_order');
+ $tables = $this->tdmcreate->getHandler('tables')->getObjects($criteria);
+ unset($criteria);
+ return $tables;
+ }
+
/**
* @public function getTableFields
- * @param $tableId
+ * @param $mId
+ * @param $tId
* @return mixed
*/
- public function getTableFields($tableId)
+ public function getTableFields($mId, $tId)
{
$criteria = new CriteriaCompo();
- $criteria->add(new Criteria('field_tid', $tableId));
+ $criteria->add(new Criteria('field_mid', $mId)); // $mId = module Id
+ $criteria->add(new Criteria('field_tid', $tId)); // $tId = table Id
$criteria->setSort('field_order');
$fields = $this->tdmcreate->getHandler('fields')->getObjects($criteria);
unset($criteria);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminAbout.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminAbout.php 2015-05-23 04:29:24 UTC (rev 13065)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminAbout.php 2015-05-24 17:27:05 UTC (rev 13066)
@@ -85,7 +85,7 @@
$content = $this->getHeaderFilesComments($module, $filename);
$content .= <<<EOT
include __DIR__ . '/header.php';
-\$template_main = '{$moduleDirname}_admin_about.tpl';
+\$templateMain = '{$moduleDirname}_admin_about.tpl';
\$GLOBALS...
[truncated message content] |
|
From: <txm...@us...> - 2015-05-25 20:22:38
|
Revision: 13067
http://sourceforge.net/p/xoops/svn/13067
Author: txmodxoops
Date: 2015-05-25 20:22:35 +0000 (Mon, 25 May 2015)
Log Message:
-----------
Fixed field parent & logos/tdmxoops_logo.gif
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminPages.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/cache/classpaths.cache
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/language/LanguageAdmin.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/language/LanguageBlocks.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/language/LanguageDefines.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/language/LanguageHelp.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/language/LanguageMailTpl.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/language/LanguageMain.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/language/LanguageModinfo.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/sql/SqlFile.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/modules.php
Added Paths:
-----------
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/images/logos/tdmxoops_logo.gif
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminPhpCode.php
Added: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/images/logos/tdmxoops_logo.gif
===================================================================
(Binary files differ)
Index: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/images/logos/tdmxoops_logo.gif
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/images/logos/tdmxoops_logo.gif 2015-05-24 17:27:05 UTC (rev 13066)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/images/logos/tdmxoops_logo.gif 2015-05-25 20:22:35 UTC (rev 13067)
Property changes on: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/images/logos/tdmxoops_logo.gif
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/fields.php 2015-05-24 17:27:05 UTC (rev 13066)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/fields.php 2015-05-25 20:22:35 UTC (rev 13067)
@@ -19,7 +19,8 @@
* @version $Id: 1.91 fields.php 12258 2014-01-02 09:33:29Z timgno $
*/
defined('XOOPS_ROOT_PATH') or die('Restricted access');
-
+// Autoloader Classes
+include __DIR__ . '/TDMCreateAutoload.php';
/*
* @Class TDMCreateFields
* @extends XoopsObject
@@ -233,9 +234,9 @@
unset($criteriaElement, $criteriaTable);
$parametersTray->addElement($fieldElementsSelect);
- $field_parent = 0;
- $checkFieldParent = new XoopsFormCheckBox(' ', 'field_parent[' . $i . ']');
- $checkFieldParent->addOption($field_parent, _AM_TDMCREATE_FIELD_PARENT);
+ $field_parent = 0;
+ $checkFieldParent = new XoopsFormCheckBox(' ', 'field_parent[' . $i . ']', $field_parent);
+ $checkFieldParent->addOption(1, _AM_TDMCREATE_FIELD_PARENT);
$parametersTray->addElement($checkFieldParent);
/*$field_parent = (1 == $tableAutoincrement) ? 2 : 1;
$checkFieldParent = new TDMCreateFormRadio('', 'field_parent', $field_parent);
@@ -302,9 +303,10 @@
$class = 'even';
// Get the number of fields - goffy
$tablesHandler =& $this->tdmcreate->getHandler('tables');
- $tableAutoincrement = $tablesHandler->get($fieldTid)->getVar('table_autoincrement');
- $fieldNumb = $tablesHandler->get($fieldTid)->getVar('table_nbfields');
- $fName = $tablesHandler->get($fieldTid)->getVar('table_fieldname');
+ $tables = $tablesHandler->get($fieldTid);
+ $tableAutoincrement = $tables->getVar('table_autoincrement');
+ $fieldNumb = $tables->getVar('table_nbfields');
+ $fName = $tables->getVar('table_fieldname');
// Get the list of fields
$criteria = new CriteriaCompo();
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminPages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminPages.php 2015-05-24 17:27:05 UTC (rev 13066)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminPages.php 2015-05-25 20:22:35 UTC (rev 13067)
@@ -16,7 +16,7 @@
* @package tdmcreate
* @since 2.5.0
* @author Txmod Xoops http://www.txmodxoops.org
- * @version $Id: pages.php 12258 2014-01-02 09:33:29Z timgno $
+ * @version $Id: AdminPages.php 12258 2014-01-02 09:33:29Z timgno $
*/
defined('XOOPS_ROOT_PATH') or die('Restricted access');
/**
Added: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminPhpCode.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminPhpCode.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminPhpCode.php 2015-05-25 20:22:35 UTC (rev 13067)
@@ -0,0 +1,493 @@
+<?php
+/*
+ You may not change or alter any portion of this comment or credits
+ of supporting developers from this source code or any supporting source code
+ which is considered copyrighted (c) material of the original comment or credit authors.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+/**
+ * tdmcreate module
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package tdmcreate
+ * @since 2.5.0
+ * @author Txmod Xoops http://www.txmodxoops.org
+ * @version $Id: AdminPhpCode.php 12258 2014-01-02 09:33:29Z timgno $
+ */
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
+/**
+ * Class AdminPhpCode
+ */
+class AdminPhpCode extends AdminObjects
+{
+ /*
+ * @var string
+ */
+ private $adminobjects;
+
+ /*
+ * @public function constructor
+ * @param null
+ */
+ /**
+ *
+ */
+ public function __construct()
+ {
+ parent::__construct();
+ $this->adminobjects = AdminObjects::getInstance();
+ }
+
+ /*
+ * @static function &getInstance
+ * @param null
+ */
+ /**
+ * @return AdminPhpCode
+ */
+ public static function &getInstance()
+ {
+ static $instance = false;
+ if (!$instance) {
+ $instance = new self();
+ }
+
+ return $instance;
+ }
+
+ /*
+ * @public function getAdminIncludeHeader
+ * @param null
+ * @return string
+ */
+ public function getAdminIncludeHeader()
+ {
+ $ret = <<<EOT
+include __DIR__ . '/header.php';\n
+EOT;
+
+ return $ret;
+ }
+
+ /**
+ * @public function getAdminSwitch
+ * @param $content
+ * @return string
+ */
+ public function getAdminSwitch($content)
+ {
+ $ret = <<<EOT
+switch {\n
+ \t{$content}
+}\n
+EOT;
+
+ return $ret;
+ }
+
+ /**
+ * @public function getAdminStringCaseDefaultSwitch
+ * @param $case
+ * @param $content
+ * @return string
+ */
+ public function getAdminStringCaseDefaultSwitch($case = 'list', $content)
+ {
+ $ret = <<<EOT
+ case '{$case}':
+ default:\n
+ \t\t{$content}
+ break;\n
+EOT;
+
+ return $ret;
+ }
+
+ /**
+ * @public function getAdminStringCaseSwitch
+ * @param $case
+ * @param $content
+ * @return string
+ */
+ public function getAdminStringCaseSwitch($case = 'list', $content)
+ {
+ $ret = <<<EOT
+ case '{$case}':\n
+ \t\t{$content}
+ break;\n
+EOT;
+
+ return $ret;
+ }
+
+ /*
+ * @public function getAdminNumericCaseDefaultSwitch
+ * @param $case
+ * @return string
+ */
+ public function getAdminNumericCaseDefaultSwitch($case = 1)
+ {
+ $ret = <<<EOT
+ case {$case}:
+ default:\n
+ \t\t{$content}
+ break;\n
+EOT;
+
+ return $ret;
+ }
+
+ /*
+ * @public function getAdminNumericCaseSwitch
+ * @param $case
+ * @return string
+ */
+ public function getAdminNumericCaseSwitch($case = 1)
+ {
+ $ret = <<<EOT
+ case {$case}:\n
+ \t\t{$content}
+ break;\n
+EOT;
+
+ return $ret;
+ }
+
+ /*
+ * @public function getAdminTemplateMain
+ * @param $moduleDirname
+ * @param $tableName
+ * @return string
+ */
+ public function getAdminTemplateMain($moduleDirname, $tableName)
+ {
+ $ret = <<<EOT
+ \$templateMain = '{$moduleDirname}_admin_{$tableName}.tpl';\n
+EOT;
+
+ return $ret;
+ }
+
+ /**
+ * @public function getAdminXoopsTplAssign
+ * @param string $tplString
+ * @param string $phpRender
+ * @return string
+ */
+ public function getAdminXoopsTplAssign($tplString, $phpRender)
+ {
+ $ret = <<<EOT
+ \$GLOBALS['xoopsTpl']->assign('{$tplString}', \${$phpRender});\n
+EOT;
+
+ return $ret;
+ }
+
+ /**
+ * @public function getAdminXoopsTplAppend
+ * @param string $tplString
+ * @param string $phpRender
+ * @return string
+ */
+ public function getAdminXoopsTplAppend($tplString, $phpRender)
+ {
+ $ret = <<<EOT
+ \$GLOBALS['xoopsTpl']->append('{$tplString}', \${$phpRender});\n
+EOT;
+
+ return $ret;
+ }
+
+ /**
+ * @public function getAdminXoopsTplAppendByRef
+ * @param string $tplString
+ * @param string $phpRender
+ * @return string
+ */
+ public function getAdminXoopsTplAppendByRef($tplString, $phpRender)
+ {
+ $ret = <<<EOT
+ \$GLOBALS['xoopsTpl']->appendByRef('{$tplString}', \${$phpRender});\n
+EOT;
+
+ return $ret;
+ }
+
+ /*
+ * @public function getAdminTemplateMain
+ * @param $moduleDirname
+ * @param $tableName
+ * @param $admin
+ * @return string
+ */
+ public function getAdminItemButton($moduleDirname, $tableName, $admin = false)
+ {
+ $ret = <<<EOT
+ \$adminMenu->addItemButton({$language}ADD_{$stuTableSoleName}, '{$tableName}.php?op=new', 'add');
+ \$adminMenu->addItemButton({$language}{$stuTableName}_LIST, '{$tableName}.php', 'list');
+ \$GLOBALS['xoopsTpl']->assign('navigation', \$adminMenu->addNavigation('{$tableName}.php'));
+ \$GLOBALS['xoopsTpl']->assign('buttons', \$adminMenu->renderButton());\n
+EOT;
+
+ return $ret;
+ }
+
+ /**
+ * @public function getAdminAddNavigation
+ * @param $tableName
+ * @return string
+ */
+ public function getAdminAddNavigation($tableName)
+ {
+ $ret = <<<EOT
+ \$GLOBALS['xoopsTpl']->assign('navigation', \$adminMenu->addNavigation('{$tableName}.php'));\n
+EOT;
+
+ return $ret;
+ }
+
+ /**
+ * @public function getAdminObjHandlerCreate
+ * @param string $tableName
+ * @return string
+ */
+ public function getAdminObjHandlerCreate($tableName)
+ {
+ $ret = <<<EOT
+ \${$tableName}Obj =& \${$tableName}Handler->create();\n
+EOT;
+
+ return $ret;
+ }
+
+ /**
+ * @public function getAdminPhpCodeSetVarsObjects
+ * @param $moduleDirname
+ * @param $tableName
+ * @param $fields
+ * @return string
+ */
+ public function getAdminPhpCodeSetVarsObjects($moduleDirname, $tableName, $fields)
+ {
+ $ret = <<<EOT
+ // Set Vars\n
+EOT;
+ foreach (array_keys($fields) as $f) {
+ $fieldName = $fields[$f]->getVar('field_name');
+ $fieldElement = $fields[$f]->getVar('field_element');
+ if ($f > 0) { // If we want to hide field id
+ switch ($fieldElement) {
+ case 5:
+ case 6:
+ $ret .= $this->adminobjects->getCheckBoxOrRadioYNSetVar($tableName, $fieldName);
+ break;
+ case 11:
+ $ret .= $this->adminobjects->getImageListSetVar($moduleDirname, $tableName, $fieldName);
+ break;
+ case 12:
+ $ret .= $this->adminobjects->getUrlFileSetVar($moduleDirname, $tableName, $fieldName);
+ break;
+ case 13:
+ if(1 == $fields[$f]->getVar('field_main')) {
+ $fieldMain = $fieldName;
+ }
+ $ret .= $this->adminobjects->getUploadImageSetVar($moduleDirname, $tableName, $fieldName, $fieldMain);
+ break;
+ case 14:
+ $ret .= $this->adminobjects->getUploadFileSetVar($moduleDirname, $tableName, $fieldName);
+ break;
+ case 15:
+ $ret .= $this->adminobjects->getTextDateSelectSetVar($tableName, $fieldName);
+ break;
+ default:
+ $ret .= $this->adminobjects->getSimpleSetVar($tableName, $fieldName);
+ break;
+ }
+ }
+ }
+
+ return $ret;
+ }
+
+ /*
+ * @public function getAdminPhpCodeInsertData
+ * @param $tableName
+ * @param $language
+ * @return string
+ */
+ public function getAdminPhpCodeInsertData($tableName, $language)
+ {
+ $ret = <<<EOT
+ // Insert Data
+ if (\${$tableName}Handler->insert(\${$tableName}Obj)) {
+ redirect_header('{$tableName}.php?op=list', 2, {$language}FORMOK);
+ }\n
+EOT;
+
+ return $ret;
+ }
+
+ /**
+ * @public function getAdminPhpCodeXoopsSecurity
+ * @param $tableName
+ * @return string
+ */
+ public function getAdminPhpCodeXoopsSecurity($tableName)
+ {
+ $ret = <<<EOT
+ if ( !\$GLOBALS['xoopsSecurity']->check() ) {
+ redirect_header('{$tableName}.php', 3, implode(',', \$GLOBALS['xoopsSecurity']->getErrors()));
+ }\n
+EOT;
+
+ return $ret;
+ }
+
+ /*
+ * @public function getAdminPhpCodeInsertData
+ * @param $tableName
+ * @param $language
+ * @return string
+ */
+ public function getAdminPhpCodeInsertData($tableName, $language)
+ {
+ $ret = <<<EOT
+ // Insert Data
+ if (\${$tableName}Handler->insert(\${$tableName}Obj)) {
+ redirect_header('{$tableName}.php?op=list', 2, {$language}FORMOK);
+ }\n
+EOT;
+
+ return $ret;
+ }
+
+ /**
+ * @public function getAdminPhpCodeGetFormError
+ * @param $tableName
+ * @return string
+ */
+ public function getAdminPhpCodeGetFormError($tableName)
+ {
+ $ret = <<<EOT
+ // Get Form
+ \$GLOBALS['xoopsTpl']->assign('error', \${$tableName}Obj->getHtmlErrors());
+ \$form =& \${$tableName}Obj->getForm();
+ \$GLOBALS['xoopsTpl']->assign('form', \$form->render());\n
+EOT;
+
+ return $ret;
+ }
+
+ /**
+ * @public function getAdminPhpCodeGetFormId
+ * @param string $tableName
+ * @param string $fieldId
+ * @return string
+ */
+ public function getAdminPhpCodeGetFormId($tableName, $fieldId)
+ {
+ $ret = <<<EOT
+ // Get Form
+ \${$tableName}Obj = \${$tableName}Handler->get(\${$fieldId});
+ \$form = \${$tableName}Obj->getForm();
+ \$GLOBALS['xoopsTpl']->assign('form', \$form->render());\n
+EOT;
+
+ return $ret;
+ }
+
+ /**
+ * @public function getAdminPhpCodeGetObjHandlerId
+ * @param string $tableName
+ * @param string $fieldId
+ * @return string
+ */
+ public function getAdminPhpCodeGetObjHandlerId($tableName, $fieldId)
+ {
+ $ret = <<<EOT
+ \${$tableName}Obj =& \${$tableName}Handler->get(\${$fieldId});\n
+EOT;
+
+ return $ret;
+ }
+
+ /*
+ * @public function getAdminPhpCodeDelete
+ * @param string $tableName
+ * @param string $language
+ * @param string $fieldId
+ * @param string $fieldMain
+ * @return string
+ */
+ public function getAdminPhpCodeDelete($tableName, $language, $fieldId, $fieldMain)
+ {
+ $ret = <<<EOT
+ case 'delete':
+ \${$tableName}Obj =& \${$tableName}Handler->get(\${$fieldId});
+ if (isset(\$_REQUEST['ok']) && 1 == \$_REQUEST['ok']) {
+ if ( !\$GLOBALS['xoopsSecurity']->check() ) {
+ redirect_header('{$tableName}.php', 3, implode(', ', \$GLOBALS['xoopsSecurity']->getErrors()));
+ }
+ if (\${$tableName}Handler->delete(\${$tableName}Obj)) {
+ redirect_header('{$tableName}.php', 3, {$language}FORMDELOK);
+ } else {
+ echo \${$tableName}Obj->getHtmlErrors();
+ }
+ } else {
+ xoops_confirm(array('ok' => 1, '{$fieldId}' => \${$fieldId}, 'op' => 'delete'), \$_SERVER['REQUEST_URI'], sprintf({$language}FORMSUREDEL, \${$tableName}Obj->getVar('{$fieldMain}')));
+ }
+ break;\n
+EOT;
+
+ return $ret;
+ }
+
+ /*
+ * @public function getAdminPhpCodeUpdate
+ * @param string $moduleDirname
+ * @param string $tableName
+ * @param string $language
+ * @param string $fieldId
+ * @param string $fieldMain
+ * @return string
+ */
+ public function getAdminPhpCodeUpdate($moduleDirname, $tableName, $language, $fieldId, $fieldMain)
+ {
+ $upModuleName = strtoupper($moduleDirname);
+ $ret = <<<EOT
+ case 'update':
+ if (isset(\${$fieldId})) {
+ \${$tableName}Obj =& \${$tableName}Handler->get(\${$fieldId});
+ }
+ \${$tableName}Obj->setVar("\${$tableName}_display", \$_POST["\${$tableName}_display"]);
+
+ if (\${$tableName}Handler->insert(\${$tableName}Obj)) {
+ redirect_header("\${$tableName}.php", 3, _AM_{$upModuleName}_FORMOK);
+ }
+ echo \${$tableName}Obj->getHtmlErrors();
+ break;\n
+EOT;
+
+ return $ret;
+ }
+
+ /*
+ * @public function getAdminIncludeFooter
+ * @param null
+ */
+ /**
+ * @return string
+ */
+ public function getAdminIncludeFooter()
+ {
+ $ret = <<<EOT
+include __DIR__ . '/footer.php';
+EOT;
+
+ return $ret;
+ }
+}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/cache/classpaths.cache
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/cache/classpaths.cache 2015-05-24 17:27:05 UTC (rev 13066)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/cache/classpaths.cache 2015-05-25 20:22:35 UTC (rev 13067)
@@ -1 +1 @@
-a:64:{s:18:"TDMCreateStructure";s:101:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\TDMCreateStructure.php";s:13:"TDMCreateFile";s:96:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\TDMCreateFile.php";s:10:"AdminPages";s:99:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\admin\AdminPages.php";s:12:"AdminObjects";s:101:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\admin\AdminObjects.php";s:19:"TemplatesAdminPages";s:118:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\admin\TemplatesAdminPages.php";s:11:"BlocksFiles";s:101:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\blocks\BlocksFiles.php";s:15:"TemplatesBlocks";s:115:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\blocks\TemplatesBlocks.php";s:10:"ClassFiles";s:101:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\classes\ClassFiles.php";s:9:"UserPages";s:97:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserPages.php";s:18:"TemplatesUserPages";s:116:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\user\TemplatesUserPages.php";s:15:"LanguageModinfo";s:107:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\language\LanguageModinfo.php";s:11:"AdminHeader";s:100:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\admin\AdminHeader.php";s:10:"AdminIndex";s:99:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\admin\AdminIndex.php";s:9:"AdminMenu";s:98:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\admin\AdminMenu.php";s:10:"AdminAbout";s:99:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\admin\AdminAbout.php";s:11:"AdminFooter";s:100:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\admin\AdminFooter.php";s:19:"TemplatesAdminAbout";s:118:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\admin\TemplatesAdminAbout.php";s:19:"TemplatesAdminIndex";s:118:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\admin\TemplatesAdminIndex.php";s:20:"TemplatesAdminFooter";s:119:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\admin\TemplatesAdminFooter.php";s:20:"TemplatesAdminHeader";s:119:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\admin\TemplatesAdminHeader.php";s:13:"LanguageAdmin";s:105:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\language\LanguageAdmin.php";s:11:"ClassHelper";s:102:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\classes\ClassHelper.php";s:16:"IncludeFunctions";s:107:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\include\IncludeFunctions.php";s:14:"IncludeInstall";s:105:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\include\IncludeInstall.php";s:14:"LanguageBlocks";s:106:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\language\LanguageBlocks.php";s:16:"AdminPermissions";s:105:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\admin\AdminPermissions.php";s:25:"TemplatesAdminPermissions";s:124:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\admin\TemplatesAdminPermissions.php";s:20:"IncludeNotifications";s:111:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\include\IncludeNotifications.php";s:15:"LanguageMailTpl";s:107:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\language\LanguageMailTpl.php";s:7:"SqlFile";s:94:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\sql\SqlFile.php";s:13:"IncludeUpdate";s:104:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\include\IncludeUpdate.php";s:13:"IncludeSearch";s:104:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\include\IncludeSearch.php";s:15:"IncludeComments";s:106:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\include\IncludeComments.php";s:23:"IncludeCommentFunctions";s:114:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\include\IncludeCommentFunctions.php";s:18:"TemplatesUserIndex";s:116:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\user\TemplatesUserIndex.php";s:19:"TemplatesUserFooter";s:117:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\user\TemplatesUserFooter.php";s:19:"TemplatesUserHeader";s:117:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\user\TemplatesUserHeader.php";s:10:"UserFooter";s:98:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserFooter.php";s:10:"UserHeader";s:98:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserHeader.php";s:22:"UserNotificationUpdate";s:110:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserNotificationUpdate.php";s:10:"UserBroken";s:98:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserBroken.php";s:19:"TemplatesUserBroken";s:117:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\user\TemplatesUserBroken.php";s:9:"UserPrint";s:97:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserPrint.php";s:18:"TemplatesUserPrint";s:116:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\user\TemplatesUserPrint.php";s:8:"UserRate";s:96:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserRate.php";s:17:"TemplatesUserRate";s:115:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\user\TemplatesUserRate.php";s:10:"UserSubmit";s:98:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserSubmit.php";s:19:"TemplatesUserSubmit";s:117:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\user\TemplatesUserSubmit.php";s:11:"UserListTag";s:99:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserListTag.php";s:11:"UserViewTag";s:99:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserViewTag.php";s:9:"UserIndex";s:97:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserIndex.php";s:12:"LanguageMain";s:104:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\language\LanguageMain.php";s:9:"CssStyles";s:96:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\css\CssStyles.php";s:13:"IncludeCommon";s:104:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\include\IncludeCommon.php";s:13:"DocsChangelog";s:101:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\docs\DocsChangelog.php";s:12:"LanguageHelp";s:104:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\language\LanguageHelp.php";s:13:"IncludeJquery";s:104:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\include\IncludeJquery.php";s:16:"UserXoopsVersion";s:104:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserXoopsVersion.php";s:7:"UserRss";s:95:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserRss.php";s:16:"TemplatesUserRss";s:114:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\user\TemplatesUserRss.php";s:16:"TemplatesUserPdf";s:114:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\user\TemplatesUserPdf.php";s:10:"UserSingle";s:98:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserSingle.php";s:19:"TemplatesUserSingle";s:117:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\user\TemplatesUserSingle.php";s:9:"UserVisit";s:97:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserVisit.php";}
\ No newline at end of file
+a:64:{s:18:"TDMCreateStructure";s:101:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\TDMCreateStructure.php";s:13:"TDMCreateFile";s:96:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\TDMCreateFile.php";s:10:"AdminPages";s:99:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\admin\AdminPages.php";s:12:"AdminObjects";s:101:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\admin\AdminObjects.php";s:19:"TemplatesAdminPages";s:118:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\admin\TemplatesAdminPages.php";s:11:"BlocksFiles";s:101:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\blocks\BlocksFiles.php";s:15:"TemplatesBlocks";s:115:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\blocks\TemplatesBlocks.php";s:10:"ClassFiles";s:101:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\classes\ClassFiles.php";s:9:"UserPages";s:97:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserPages.php";s:18:"TemplatesUserPages";s:116:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\user\TemplatesUserPages.php";s:15:"LanguageModinfo";s:107:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\language\LanguageModinfo.php";s:11:"AdminHeader";s:100:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\admin\AdminHeader.php";s:10:"AdminIndex";s:99:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\admin\AdminIndex.php";s:9:"AdminMenu";s:98:...
[truncated message content] |
|
From: <txm...@us...> - 2015-05-27 10:06:26
|
Revision: 13071
http://sourceforge.net/p/xoops/svn/13071
Author: txmodxoops
Date: 2015-05-27 10:06:24 +0000 (Wed, 27 May 2015)
Log Message:
-----------
Fix missing value type sql/SqlFile.php
XML Rss
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateArchitecture.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/sql/SqlFile.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/templates/user/TemplatesUserRss.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/user/UserRss.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/fields.php 2015-05-26 09:35:26 UTC (rev 13070)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/fields.php 2015-05-27 10:06:24 UTC (rev 13071)
@@ -238,25 +238,25 @@
$fieldsObj = $tdmcreate->getHandler('fields')->get( $fieldId );
$form = $fieldsObj->getFormEdit($fieldMid, $fieldTid);
$GLOBALS['xoopsTpl']->assign('form', $form->render());
- break;
-
- case 'order':
- // Initialize fields handler
+ break;
+
+ case 'order':
+ // Initialize fields handler
$fieldsObj = $tdmcreate->getHandler('fields');
- if ( isset($_POST['forder'] ) ) {
+ if (isset($_POST['forder'])) {
$i = 0;
- foreach($_POST['forder'] as $order) {
- if( $order > 0 ) {
+ foreach ($_POST['forder'] as $order) {
+ if ($order > 0) {
$fieldOrder = $fieldsObj->get($order);
$fieldOrder->setVar('field_order', $i);
if (!$fieldsObj->insert($fieldOrder)) {
- $error=true;
+ $error = true;
}
- $i++;
+ ++$i;
}
}
- redirect_header('fields.php', 5, _AM_TDMCREATE_FIELD_ORDER_ERROR);
- unset($i);
+ redirect_header('fields.php', 5, _AM_TDMCREATE_FIELD_ORDER_ERROR);
+ unset($i);
}
exit;
break;
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateArchitecture.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateArchitecture.php 2015-05-26 09:35:26 UTC (rev 13070)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateArchitecture.php 2015-05-27 10:06:24 UTC (rev 13071)
@@ -493,7 +493,7 @@
$ret[] = $userRss->render();
// User Templates Rss File
$userTemplatesRss = TemplatesUserRss::getInstance();
- $userTemplatesRss->write($module, $table);
+ $userTemplatesRss->write($module);
$ret[] = $userTemplatesRss->renderFile($moduleDirname . '_rss.tpl');
}
// User Single File
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/sql/SqlFile.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/sql/SqlFile.php 2015-05-26 09:35:26 UTC (rev 13070)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/sql/SqlFile.php 2015-05-27 10:06:24 UTC (rev 13071)
@@ -194,7 +194,7 @@
case 3:
case 4:
case 5:
- $type = $fieldTypeName;
+ $type = $fieldTypeName . '(' . $fieldValue . ')';
if(empty($fieldDefault)) {
$default = "DEFAULT '0'";
} else {
@@ -204,7 +204,7 @@
case 6:
case 7:
case 8:
- $type = $fieldTypeName;
+ $type = $fieldTypeName . '(' . $fieldValue . ')';
if(empty($fieldDefault)) {
$default = "DEFAULT '0.00'"; // From MySQL 5.7 Manual
} else {
@@ -216,7 +216,7 @@
$type = $fieldTypeName;
break;
case 11:
- $type = $fieldTypeName;
+ $type = $fieldTypeName . '(' . $fieldValue . ')';
if(empty($fieldDefault)) {
$default = "DEFAULT 'my...@em...'";
} else {
@@ -224,7 +224,7 @@
}
break;
case 12:
- $type = $fieldTypeName;
+ $type = $fieldTypeName . '(' . $fieldValue . ')';
if(empty($fieldDefault)) {
$default = "DEFAULT 'http:\\'";
} else {
@@ -233,8 +233,8 @@
break;
case 13:
case 14:
- $type = $fieldTypeName;
- $default = "DEFAULT ''";
+ $type = $fieldTypeName . '(' . $fieldValue . ')';
+ $default = "DEFAULT '{$fieldDefault}'";
break;
case 15:
case 16:
@@ -247,12 +247,8 @@
case 20:
case 21:
case 22:
- $type = $fieldTypeName;
- /*if(empty($fieldDefault)) {
- $default = "DEFAULT '0'";
- } else {*/
- $default = "DEFAULT '{$fieldDefault}'";
- //}
+ $type = $fieldTypeName . '(' . $fieldValue . ')';
+ $default = "DEFAULT '{$fieldDefault}'";
break;
case 23:
$type = $fieldTypeName;
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/templates/user/TemplatesUserRss.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/templates/user/TemplatesUserRss.php 2015-05-26 09:35:26 UTC (rev 13070)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/templates/user/TemplatesUserRss.php 2015-05-27 10:06:24 UTC (rev 13071)
@@ -65,14 +65,13 @@
* @param $module
* @param $table
*/
- public function write($module, $table)
+ public function write($module)
{
$this->setModule($module);
- $this->setTable($table);
}
-
+
/*
- * @private function getTemplatesUserRssHeader
+ * @private function getTemplatesUserRssXml
* @param string $moduleDirname
* @param string $table
* @param string $language
@@ -83,158 +82,42 @@
* @param $language
* @return string
*/
- private function getTemplatesUserRssHeader($moduleDirname, $table, $language)
+ private function getTemplatesUserRssXml()
{
- $ret = <<<EOT
-<{include file="db:{$moduleDirname}_header.tpl"}>
-<table class="{$moduleDirname}">
- <thead class="outer">
- <tr class="head">\n
-EOT;
- $fields = $this->getTableFields($table->getVar('table_mid'), $table->getVar('table_id'));
- foreach (array_keys($fields) as $f) {
- $fieldName = $fields[$f]->getVar('field_name');
- $langStuFieldName = $language . strtoupper($fieldName);
- if ((1 == $table->getVar('table_autoincrement')) || (1 == $fields[$f]->getVar('field_user'))) {
- $ret .= <<<EOT
- <th class="center"><{\$smarty.const.{$langStuFieldName}}></th>\n
-EOT;
- }
- }
- $ret .= <<<EOT
- </tr>
- </thead>\n
-EOT;
-
- return $ret;
- }
-
- /*
- * @private function getTemplatesUserRssBody
- * @param string $moduleDirname
- * @param string $table
- * @param string $language
- */
- /**
- * @param $moduleDirname
- * @param $table
- * @param $language
- * @return string
- */
- private function getTemplatesUserRssBody($moduleDirname, $table, $language)
- {
- $tableName = $table->getVar('table_name');
- $ret = <<<EOT
- <tbody>
- <{foreach item=list from=\${$tableName}}>
- <tr class="<{cycle values='odd, even'}>">\n
-EOT;
- $fields = $this->getTableFields($table->getVar('table_mid'), $table->getVar('table_id'));
- foreach (array_keys($fields) as $f) {
- $fieldName = $fields[$f]->getVar('field_name');
- $fieldElement = $fields[$f]->getVar('field_element');
- $rpFieldName = $this->tdmcfile->getRightString($fieldName);
- if ((1 == $table->getVar('table_autoincrement')) || (1 == $fields[$f]->getVar('field_user'))) {
- switch ($fieldElement) {
- case 9:
- $ret .= <<<EOT
- <td class="center"><span style="background-color: #<{\$list.{$rpFieldName}}>;">\t\t</span></td>\n
-EOT;
- break;
- case 10:
- $ret .= <<<EOT
- <td class="center"><img src="<{xoModuleIcons32}><{\$list.{$rpFieldName}}>" alt="{$tableName}"></td>\n
-EOT;
- break;
- case 13:
- $ret .= <<<EOT
- <td class="center"><img src="<{\${$moduleDirname}_upload_url}>/images/{$tableName}/<{\$list.{$rpFieldName}}>" alt="{$tableName}"></td>\n
-EOT;
- break;
- default:
- $ret .= <<<EOT
- <td class="center"><{\$list.{$rpFieldName}}></td>\n
-EOT;
- break;
- }
- }
- }
- $ret .= <<<EOT
- </tr>
- <{/foreach}>
- </tbody>
-</table>\n
-EOT;
-
- return $ret;
- }
-
- /*
- * @private function getTemplatesUserRssBodyFieldnameEmpty
- * @param string $moduleDirname
- * @param string $table
- * @param string $language
- */
- /**
- * @param $moduleDirname
- * @param $table
- * @param $language
- * @return string
- */
- private function getTemplatesUserRssBodyFieldnameEmpty($moduleDirname, $table, $language)
- {
- $tableName = $table->getVar('table_name');
- $ret = <<<EOT
- <tbody>
- <{foreach item=list from=\${$tableName}}>
- <tr class="<{cycle values='odd, even'}>">\n
-EOT;
- $fields = $this->getTableFields($table->getVar('table_mid'), $table->getVar('table_id'));
- foreach (array_keys($fields) as $f) {
- $fieldName = $fields[$f]->getVar('field_name');
- $fieldElement = $fields[$f]->getVar('field_element');
- if ((1 == $table->getVar('table_autoincrement')) || (1 == $fields[$f]->getVar('field_user'))) {
- switch ($fieldElement) {
- case 9:
- $ret .= <<<EOT
- <td class="center"><span style="background-color: #<{\$list.{$fieldName}}>;"></span></td>\n
-EOT;
- break;
- case 13:
- $ret .= <<<EOT
- <td class="center"><img src="<{\${$moduleDirname}_upload_url}>/images/{$tableName}/<{\$list.{$fieldName}}>" alt="{$tableName}"></td>\n
-EOT;
- break;
- default:
- $ret .= <<<EOT
- <td class="center"><{\$list.{$fieldName}}></td>\n
-EOT;
- break;
- }
- }
- }
- $ret .= <<<EOT
- </tr>
- <{/foreach}>
- </tbody>
-</table>\n
-EOT;
-
- return $ret;
- }
-
- /*
- * @private function getTemplatesUserRssFooter
- * @param string $moduleDirname
- */
- /**
- * @param $moduleDirname
- * @return string
- */
- private function getTemplatesUserRssFooter($moduleDirname)
- {
$ret = <<<EOT
-<{include file="db:{$moduleDirname}_footer.tpl"}>
+<?xml version="1.0" encoding="UTF-8"?>
+<rss version="2.0">
+ <channel>
+ <title><{\$channel_title}></title>
+ <link><{\$channel_link}></link>
+ <description><{\$channel_desc}></description>
+ <lastBuildDate><{\$channel_lastbuild}></lastBuildDate>
+ <docs>http://backend.userland.com/rss/</docs>
+ <generator><{\$channel_generator}></generator>
+ <category><{\$channel_category}></category>
+ <managingEditor><{\$channel_editor}></managingEditor>
+ <webMaster><{\$channel_webmaster}></webMaster>
+ <language><{\$channel_language}></language>
+ <{if \$image_url != ""}>
+ <image>
+ <title><{\$channel_title}></title>
+ <url><{\$image_url}></url>
+ <link><{\$channel_link}></link>
+ <width><{\$image_width}></width>
+ <height><{\$image_height}></height>
+ </image>
+ <{/if}>
+ <{foreach item=item from=\$items}>
+ <item>
+ <title><{\$item.title}></title>
+ <link><{\$item.link}></link>
+ <description><{\$item.description}></description>
+ <pubDate><{\$item.pubdate}></pubDate>
+ <guid><{\$item.guid}></guid>
+ </item>
+ <{/foreach}>
+ </channel>
+</rss>\n
EOT;
return $ret;
@@ -251,18 +134,9 @@
public function renderFile($filename)
{
$module = $this->getModule();
- $table = $this->getTable();
$moduleDirname = $module->getVar('mod_dirname');
- $tableFieldname = $table->getVar('table_fieldname');
$language = $this->getLanguage($moduleDirname, 'MA');
- $content = $this->getTemplatesUserRssHeader($moduleDirname, $table, $language);
- // Verify if table_fieldname is not empty
- if (!empty($tableFieldname)) {
- $content .= $this->getTemplatesUserRssBody($moduleDirname, $table, $language);
- } else {
- $content .= $this->getTemplatesUserRssBodyFieldnameEmpty($moduleDirname, $table, $language);
- }
- $content .= $this->getTemplatesUserRssFooter($moduleDirname);
+ $content = $this->getTemplatesUserRssXml();
//
$this->tdmcfile->create($moduleDirname, 'templates', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/user/UserRss.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/user/UserRss.php 2015-05-26 09:35:26 UTC (rev 13070)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/user/UserRss.php 2015-05-27 10:06:24 UTC (rev 13071)
@@ -107,7 +107,9 @@
}
if (1 == $fields[$f]->getVar('field_parent')) {
$fieldParent = $fieldName;
- }
+ } else {
+ $fieldParent = 'cid';
+ }
}
$ret = <<<EOT
@@ -140,7 +142,7 @@
\${$tableName}Arr = \${$tableName}Handler->getAll(\$criteria);
unset(\$criteria);
-if (!\$tpl->is_cached('db:rss.tpl', \${$fieldParent})) {
+if (!\$tpl->is_cached('db:{$moduleDirname}_rss.tpl', \${$fieldParent})) {
\$tpl->assign('channel_title', htmlspecialchars(\$title, ENT_QUOTES));
\$tpl->assign('channel_link', XOOPS_URL.'/');
\$tpl->assign('channel_desc', htmlspecialchars(\$xoopsConfig['slogan'], ENT_QUOTES));
@@ -185,7 +187,7 @@
}
}
header("Content-Type:text/xml; charset=" . _CHARSET);
-\$tpl->display('db:rss.tpl', \${$fieldParent});
+\$tpl->display('db:{$moduleDirname}_rss.tpl', \${$fieldParent});
EOT;
return $ret;
|
|
From: <txm...@us...> - 2015-05-27 14:19:08
|
Revision: 13072
http://sourceforge.net/p/xoops/svn/13072
Author: txmodxoops
Date: 2015-05-27 14:19:05 +0000 (Wed, 27 May 2015)
Log Message:
-----------
Major changes in lists and language
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/about.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminIndex.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/cache/classpaths.cache
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/classes/ClassFormElements.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/include/IncludeInstall.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/language/LanguageAdmin.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/language/LanguageMain.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/templates/admin/TemplatesAdminPages.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/about.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/about.php 2015-05-27 10:06:24 UTC (rev 13071)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/about.php 2015-05-27 14:19:05 UTC (rev 13072)
@@ -19,7 +19,7 @@
* @version $Id: about.php 11084 2013-02-23 15:44:20Z timgno $
*/
include __DIR__ . '/header.php';
-$template_main = 'tdmcreate_about.tpl';
+$templateMain = 'tdmcreate_about.tpl';
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('about.php'));
$GLOBALS['xoopsTpl']->assign('about', $adminMenu->renderAbout('6KJ7RW5DR3VTJ', false));
include __DIR__ . '/footer.php';
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminIndex.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminIndex.php 2015-05-27 10:06:24 UTC (rev 13071)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminIndex.php 2015-05-27 14:19:05 UTC (rev 13072)
@@ -126,7 +126,29 @@
\$adminMenu->addInfoBoxLine({$language}STATISTICS, '<label>No statistics</label>', 0);\n
EOT;
}
- $content .= <<<EOT
+ if (is_array($tables)) {
+ $content .= <<<EOT
+// Upload Folders
+\$folder = array(\n
+EOT;
+ $stuModuleDirname = strtoupper($moduleDirname);
+ foreach (array_keys($tables) as $i) {
+ $tableName = $tables[$i]->getVar('table_name');
+ $content .= <<<EOT
+ \t{$stuModuleDirname}_UPLOAD_PATH . '/{$tableName}/',\n
+EOT;
+ }
+ $content .= <<<EOT
+);
+
+// Uploads Folders Created
+foreach (array_keys( \$folder) as \$i) {
+ \$adminMenu->addConfigBoxLine(\$folder[\$i], 'folder');
+ \$adminMenu->addConfigBoxLine(array(\$folder[\$i], '777'), 'chmod');
+}\n
+EOT;
+ }
+ $content .= <<<EOT
// Render Index
echo \$adminMenu->addNavigation('index.php');
echo \$adminMenu->renderIndex();
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/cache/classpaths.cache
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/cache/classpaths.cache 2015-05-27 10:06:24 UTC (rev 13071)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/cache/classpaths.cache 2015-05-27 14:19:05 UTC (rev 13072)
@@ -1 +1 @@
-a:64:{s:18:"TDMCreateStructure";s:101:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\TDMCreateStructure.php";s:13:"TDMCreateFile";s:96:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\TDMCreateFile.php";s:10:"AdminPages";s:99:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\admin\AdminPages.php";s:12:"AdminObjects";s:101:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\admin\AdminObjects.php";s:19:"TemplatesAdminPages";s:118:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\admin\TemplatesAdminPages.php";s:11:"BlocksFiles";s:101:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\blocks\BlocksFiles.php";s:15:"TemplatesBlocks";s:115:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\blocks\TemplatesBlocks.php";s:10:"ClassFiles";s:101:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\classes\ClassFiles.php";s:9:"UserPages";s:97:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserPages.php";s:18:"TemplatesUserPages";s:116:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\user\TemplatesUserPages.php";s:15:"LanguageModinfo";s:107:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\language\LanguageModinfo.php";s:11:"AdminHeader";s:100:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\admin\AdminHeader.php";s:10:"AdminIndex";s:99:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\admin\AdminIndex.php";s:9:"AdminMenu";s:98:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\admin\AdminMenu.php";s:10:"AdminAbout";s:99:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\admin\AdminAbout.php";s:11:"AdminFooter";s:100:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\admin\AdminFooter.php";s:19:"TemplatesAdminAbout";s:118:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\admin\TemplatesAdminAbout.php";s:19:"TemplatesAdminIndex";s:118:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\admin\TemplatesAdminIndex.php";s:20:"TemplatesAdminFooter";s:119:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\admin\TemplatesAdminFooter.php";s:20:"TemplatesAdminHeader";s:119:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\admin\TemplatesAdminHeader.php";s:13:"LanguageAdmin";s:105:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\language\LanguageAdmin.php";s:11:"ClassHelper";s:102:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\classes\ClassHelper.php";s:16:"IncludeFunctions";s:107:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\include\IncludeFunctions.php";s:14:"IncludeInstall";s:105:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\include\IncludeInstall.php";s:7:"SqlFile";s:94:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\sql\SqlFile.php";s:13:"IncludeUpdate";s:104:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\include\IncludeUpdate.php";s:18:"TemplatesUserIndex";s:116:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\user\TemplatesUserIndex.php";s:19:"TemplatesUserFooter";s:117:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\user\TemplatesUserFooter.php";s:19:"TemplatesUserHeader";s:117:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\user\TemplatesUserHeader.php";s:10:"UserFooter";s:98:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserFooter.php";s:10:"UserHeader";s:98:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserHeader.php";s:9:"UserIndex";s:97:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserIndex.php";s:12:"LanguageMain";s:104:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\language\LanguageMain.php";s:9:"CssStyles";s:96:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\css\CssStyles.php";s:13:"IncludeCommon";s:104:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\include\IncludeCommon.php";s:13:"DocsChangelog";s:101:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\docs\DocsChangelog.php";s:12:"LanguageHelp";s:104:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\language\LanguageHelp.php";s:13:"IncludeJquery";s:104:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\include\IncludeJquery.php";s:16:"UserXoopsVersion";s:104:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserXoopsVersion.php";s:14:"LanguageBlocks";s:106:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\language\LanguageBlocks.php";s:16:"AdminPermissions";s:105:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\admin\AdminPermissions.php";s:25:"TemplatesAdminPermissions";s:124:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\admin\TemplatesAdminPermissions.php";s:20:"IncludeNotifications";s:111:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\include\IncludeNotifications.php";s:15:"LanguageMailTpl";s:107:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\language\LanguageMailTpl.php";s:13:"IncludeSearch";s:104:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\include\IncludeSearch.php";s:15:"IncludeComments";s:106:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\include\IncludeComments.php";s:23:"IncludeCommentFunctions";s:114:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\include\IncludeCommentFunctions.php";s:22:"UserNotificationUpdate";s:110:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserNotificationUpdate.php";s:10:"UserBroken";s:98:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserBroken.php";s:19:"TemplatesUserBroken";s:117:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\user\TemplatesUserBroken.php";s:9:"UserPrint";s:97:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserPrint.php";s:16:"TemplatesUserPdf";s:114:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\user\TemplatesUserPdf.php";s:18:"TemplatesUserPrint";s:116:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\user\TemplatesUserPrint.php";s:8:"UserRate";s:96:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserRate.php";s:17:"TemplatesUserRate";s:115:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\user\TemplatesUserRate.php";s:7:"UserRss";s:95:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserRss.php";s:16:"TemplatesUserRss";s:114:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\user\TemplatesUserRss.php";s:10:"UserSingle";s:98:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserSingle.php";s:19:"TemplatesUserSingle";s:117:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\user\TemplatesUserSingle.php";s:10:"UserSubmit";s:98:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserSubmit.php";s:19:"TemplatesUserSubmit";s:117:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\user\TemplatesUserSubmit.php";s:9:"UserVisit";s:97:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserVisit.php";s:11:"UserListTag";s:99:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserListTag.php";s:11:"UserViewTag";s:99:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserViewTag.php";}
\ No newline at end of file
+a:64:{s:18:"TDMCreateStructure";s:101:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\TDMCreateStructure.php";s:13:"TDMCreateFile";s:96:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\TDMCreateFile.php";s:10:"AdminPages";s:99:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\admin\AdminPages.php";s:12:"AdminObjects";s:101:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\admin\AdminObjects.php";s:19:"TemplatesAdminPages";s:118:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\admin\TemplatesAdminPages.php";s:11:"BlocksFiles";s:101:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\blocks\BlocksFiles.php";s:15:"TemplatesBlocks";s:115:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\blocks\TemplatesBlocks.php";s:10:"ClassFiles";s:101:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\classes\ClassFiles.php";s:9:"UserPages";s:97:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserPages.php";s:18:"TemplatesUserPages";s:116:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\user\TemplatesUserPages.php";s:15:"LanguageModinfo";s:107:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\language\LanguageModinfo.php";s:11:"AdminHeader";s:100:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\admin\AdminHeader.php";s:10:"AdminIndex";s:99:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\admin\AdminIndex.php";s:9:"AdminMenu";s:98:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\admin\AdminMenu.php";s:10:"AdminAbout";s:99:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\admin\AdminAbout.php";s:11:"AdminFooter";s:100:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\admin\AdminFooter.php";s:19:"TemplatesAdminAbout";s:118:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\admin\TemplatesAdminAbout.php";s:19:"TemplatesAdminIndex";s:118:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\admin\TemplatesAdminIndex.php";s:20:"TemplatesAdminFooter";s:119:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\admin\TemplatesAdminFooter.php";s:20:"TemplatesAdminHeader";s:119:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\admin\TemplatesAdminHeader.php";s:13:"LanguageAdmin";s:105:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\language\LanguageAdmin.php";s:11:"ClassHelper";s:102:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\classes\ClassHelper.php";s:16:"IncludeFunctions";s:107:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\include\IncludeFunctions.php";s:14:"IncludeInstall";s:105:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\include\IncludeInstall.php";s:14:"LanguageBlocks";s:106:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\language\LanguageBlocks.php";s:7:"SqlFile";s:94:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\sql\SqlFile.php";s:13:"IncludeUpdate";s:104:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\include\IncludeUpdate.php";s:13:"IncludeSearch";s:104:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\include\IncludeSearch.php";s:18:"TemplatesUserIndex";s:116:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\user\TemplatesUserIndex.php";s:19:"TemplatesUserFooter";s:117:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\user\TemplatesUserFooter.php";s:19:"TemplatesUserHeader";s:117:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\user\TemplatesUserHeader.php";s:10:"UserFooter";s:98:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserFooter.php";s:10:"UserHeader";s:98:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserHeader.php";s:9:"UserIndex";s:97:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserIndex.php";s:12:"LanguageMain";s:104:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\language\LanguageMain.php";s:9:"CssStyles";s:96:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\css\CssStyles.php";s:13:"IncludeCommon";s:104:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\include\IncludeCommon.php";s:13:"DocsChangelog";s:101:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\docs\DocsChangelog.php";s:12:"LanguageHelp";s:104:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\language\LanguageHelp.php";s:13:"IncludeJquery";s:104:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\include\IncludeJquery.php";s:16:"UserXoopsVersion";s:104:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserXoopsVersion.php";s:16:"AdminPermissions";s:105:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\admin\AdminPermissions.php";s:25:"TemplatesAdminPermissions";s:124:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\admin\TemplatesAdminPermissions.php";s:20:"IncludeNotifications";s:111:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\include\IncludeNotifications.php";s:15:"LanguageMailTpl";s:107:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\language\LanguageMailTpl.php";s:15:"IncludeComments";s:106:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\include\IncludeComments.php";s:23:"IncludeCommentFunctions";s:114:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\include\IncludeCommentFunctions.php";s:22:"UserNotificationUpdate";s:110:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserNotificationUpdate.php";s:10:"UserBroken";s:98:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserBroken.php";s:19:"TemplatesUserBroken";s:117:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\user\TemplatesUserBroken.php";s:9:"UserPrint";s:97:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserPrint.php";s:16:"TemplatesUserPdf";s:114:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\user\TemplatesUserPdf.php";s:18:"TemplatesUserPrint";s:116:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\user\TemplatesUserPrint.php";s:8:"UserRate";s:96:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserRate.php";s:17:"TemplatesUserRate";s:115:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\user\TemplatesUserRate.php";s:7:"UserRss";s:95:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserRss.php";s:16:"TemplatesUserRss";s:114:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\user\TemplatesUserRss.php";s:10:"UserSingle";s:98:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserSingle.php";s:19:"TemplatesUserSingle";s:117:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\user\TemplatesUserSingle.php";s:10:"UserSubmit";s:98:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserSubmit.php";s:19:"TemplatesUserSubmit";s:117:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\user\TemplatesUserSubmit.php";s:9:"UserVisit";s:97:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserVisit.php";s:11:"UserListTag";s:99:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserListTag.php";s:11:"UserViewTag";s:99:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserViewTag.php";}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/classes/ClassFormElements.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/classes/ClassFormElements.php 2015-05-27 10:06:24 UTC (rev 13071)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/classes/ClassFormElements.php 2015-05-27 14:19:05 UTC (rev 13072)
@@ -230,8 +230,8 @@
\$iconsdirectory = is_dir(XOOPS_ROOT_PATH . \$iconsdir) ? \$iconsdir : \$uploads_dir;
//
\$imgtray1 = new XoopsFormElementTray({$language}{$stuSoleName},'<br />');
- \$imgpath = is_dir(XOOPS_ROOT_PATH . \$iconsdir) ? sprintf({$language}FORMIMAGE_PATH, ".{\$iconsdir}/") : sprintf({$language}FORMIMAGE_PATH, \$uploads_dir);
- //\$imgpath1 = sprintf({$language}FORMIMAGE_PATH, ".{\$iconsdirectory}/");
+ \$imgpath = is_dir(XOOPS_ROOT_PATH . \$iconsdir) ? sprintf({$language}FORM_IMAGE_PATH, ".{\$iconsdir}/") : sprintf({$language}FORMIMAGE_PATH, \$uploads_dir);
+ //\$imgpath1 = sprintf({$language}FORM_IMAGE_PATH, ".{\$iconsdirectory}/");
\$imageselect1 = new XoopsFormSelect(\$imgpath, '{$fieldName}', \${$fieldName}, 10);
\$image_array1 = XoopsLists::getImgListAsArray( XOOPS_ROOT_PATH . \$iconsdirectory );
foreach( \$image_array1 as \$image1 ) {
@@ -280,8 +280,8 @@
if (!is_file(\$uploaddir)){
\${$moduleDirname}cat_img = 'blank.gif';
}
- \$imgtray = new XoopsFormElementTray({$language}_FORMIMG,'<br />');
- \$imgpath = sprintf({$language}_FORMPATH, \$uploadirectory );
+ \$imgtray = new XoopsFormElementTray({$language}_FORM_IMG,'<br />');
+ \$imgpath = sprintf({$language}_FORM_PATH, \$uploadirectory );
\$imageselect = new XoopsFormSelect(\$imgpath, 'selected_img',\${$moduleDirname}cat_img);
\${$fieldName}_array = XoopsLists :: getImgListAsArray( XOOPS_ROOT_PATH . \$uploadirectory );
foreach( \${$fieldName}_array as \$image ) {
@@ -670,6 +670,9 @@
}
break;
}
+ if (($fieldElement <= 15) && (1 == $fieldParent)) {
+ $ret .= $this->getXoopsFormTopic($language, $moduleDirname, $tableName, $fieldId, $fieldPid, $fieldMain, $required);
+ }
if ($fieldElement > 15) {
if (1 == $table->getVar('table_category')) {
$fieldElements = $this->tdmcreate->getHandler('fieldelements')->get($fieldElement);
@@ -692,10 +695,10 @@
}
}
$ret .= $this->getXoopsFormTopic($language, $moduleDirname, $topicTableName, $fieldIdTopic, $fieldPidTopic, $fieldMainTopic, $required);
- } elseif (1 == $fieldParent) {
+ } else {
$ret .= $this->getXoopsFormTable($language, $moduleDirname, $tableName, $fieldName, $fieldElement, $required);
}
- }
+ }
}
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/include/IncludeInstall.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/include/IncludeInstall.php 2015-05-27 10:06:24 UTC (rev 13071)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/include/IncludeInstall.php 2015-05-27 14:19:05 UTC (rev 13072)
@@ -248,8 +248,12 @@
$filename = $this->getFileName();
$content = $this->getHeaderFilesComments($module, $filename);
$content .= $this->getInstallModuleFolder($moduleDirname);
- $fields = $this->getTableFields($table->getVar('table_mid'), $table->getVar('table_id'));
- foreach (array_keys($fields) as $f) {
+ foreach (array_keys($tables) as $t) {
+ $tableName = $tables[$t]->getVar('table_name');
+ $content .= $this->getInstallTableFolder($moduleDirname, $tableName);
+ }
+ $fields = $this->getTableFields($table->getVar('table_mid'), $table->getVar('table_id'));
+ foreach (array_keys($fields) as $f) {
$fieldElement = $fields[$f]->getVar('field_element');
// All fields elements selected
switch ($fieldElement) {
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/language/LanguageAdmin.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/language/LanguageAdmin.php 2015-05-27 10:06:24 UTC (rev 13071)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/language/LanguageAdmin.php 2015-05-27 14:19:05 UTC (rev 13072)
@@ -107,10 +107,10 @@
$ret .= $this->defines->getDefine($language, "THEREARENT_{$stuTableName}", "There aren't {$stlTableName}");
}
$ret .= $this->defines->getAboveDefines('Save/Delete');
- $ret .= $this->defines->getDefine($language, "FORMOK", "Successfully saved");
- $ret .= $this->defines->getDefine($language, "FORMDELOK", "Successfully deleted");
- $ret .= $this->defines->getDefine($language, "FORMSUREDEL", "Are you sure to delete: <b><span style='color : Red;'>%s </span></b>");
- $ret .= $this->defines->getDefine($language, "FORMSURERENEW", "Are you sure to update: <b><span style='color : Red;'>%s </span></b>");
+ $ret .= $this->defines->getDefine($language, 'FORM_OK', "Successfully saved");
+ $ret .= $this->defines->getDefine($language, 'FORM_DELETE_OK', "Successfully deleted");
+ $ret .= $this->defines->getDefine($language, 'FORM_SURE_DELETE', "Are you sure to delete: <b><span style='color : Red;'>%s </span></b>");
+ $ret .= $this->defines->getDefine($language, 'FORM_SURE_RENEW', "Are you sure to update: <b><span style='color : Red;'>%s </span></b>");
$ret .= $this->defines->getAboveDefines('Buttons');
//
foreach (array_keys($tables) as $t) {
@@ -177,7 +177,7 @@
$fieldNameDesc = ucfirst($rpFieldName);
}
//
- $ret .= $this->defines->getDefine($language, $tableSoleName .'_'. $rpFieldName, $fieldNameDesc);
+ $ret .= $this->defines->getDefine($language, $tableSoleName . '_' . $rpFieldName, $fieldNameDesc);
$stuTableName = strtoupper($tableName);
//
switch ($fieldElement) {
@@ -185,8 +185,8 @@
$ret .= $this->defines->getDefine($language, "FORM_UPLOAD_IMAGE_LIST_{$stuTableName}", "{$fieldNameDesc} in frameworks images");
break;
case 12:
- $ret .= $this->defines->getDefine($language, "URLFORM_{$stuTableName}", "{$fieldNameDesc} in text url");
- $ret .= $this->defines->getDefine($language, "URLFORM_UPLOAD", "{$fieldNameDesc} in uploads files");
+ $ret .= $this->defines->getDefine($language, "FORM_URL_{$stuTableName}", "{$fieldNameDesc} in text url");
+ $ret .= $this->defines->getDefine($language, "FORM_URL_UPLOAD", "{$fieldNameDesc} in uploads files");
break;
case 13:
$ret .= $this->defines->getDefine($language, "FORM_UPLOAD_IMAGE_{$stuTableName}", "{$fieldNameDesc} in uploads images");
@@ -198,11 +198,11 @@
}
}
$ret .= $this->defines->getAboveDefines('General');
- $ret .= $this->defines->getDefine($language, 'FORMUPLOAD', "Upload file");
- $ret .= $this->defines->getDefine($language, 'FORMIMAGE_PATH', "Files in %s ");
- $ret .= $this->defines->getDefine($language, 'FORMACTION', "Action");
- $ret .= $this->defines->getDefine($language, 'FORMEDIT', "Modification");
- $ret .= $this->defines->getDefine($language, 'FORMDEL', "Clear");
+ $ret .= $this->defines->getDefine($language, 'FORM_UPLOAD', "Upload file");
+ $ret .= $this->defines->getDefine($language, 'FORM_IMAGE_PATH', "Files in %s ");
+ $ret .= $this->defines->getDefine($language, 'FORM_ACTION', "Action");
+ $ret .= $this->defines->getDefine($language, 'FORM_EDIT', "Modification");
+ $ret .= $this->defines->getDefine($language, 'FORM_DELETE', "Clear");
return $ret;
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/language/LanguageMain.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/language/LanguageMain.php 2015-05-27 10:06:24 UTC (rev 13071)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/language/LanguageMain.php 2015-05-27 14:19:05 UTC (rev 13072)
@@ -93,24 +93,20 @@
As you can see, you've created a page with a list of links at the top to navigate between the pages of your module. This description is only visible on the homepage of this module, the other pages you will see the content you created when you built this module with the module TDMCreate, and after creating new content in admin of th...
[truncated message content] |
|
From: <txm...@us...> - 2015-06-01 11:23:00
|
Revision: 13074
http://sourceforge.net/p/xoops/svn/13074
Author: txmodxoops
Date: 2015-06-01 11:22:57 +0000 (Mon, 01 Jun 2015)
Log Message:
-----------
Fixed display toggle in modules, table & fields list
Added table_index filed to insert code in user/index.php
Needed a fresh installation
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/modules.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateArchitecture.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminObjects.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminPages.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/classes/ClassFiles.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/classes/ClassFormElements.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/include/IncludeFunctions.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/templates/admin/TemplatesAdminPages.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/templates/user/TemplatesUserIndex.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/user/UserIndex.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/user/UserPages.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/user/UserXoopsVersion.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/modules.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/sql/mysql.sql
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/templates/admin/tdmcreate_modules.tpl
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/templates/admin/tdmcreate_tables.tpl
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/templates/admin/tdmcreate_tables_item.tpl
Added Paths:
-----------
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/icons/16/rss.gif
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/icons/24/
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/icons/24/index.html
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/icons/24/next.png
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/icons/24/previous.png
Removed Paths:
-------------
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/cache/classpaths.cache
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/cache/classpaths.cache
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/fields.php 2015-05-30 10:15:43 UTC (rev 13073)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/fields.php 2015-06-01 11:22:57 UTC (rev 13074)
@@ -49,81 +49,45 @@
$GLOBALS['xoopsTpl']->assign('modPathIcon16', $modPathIcon16);
$GLOBALS['xoopsTpl']->assign('sysPathIcon32', $sysPathIcon32);
// Redirect if there aren't modules
- $countModules = $tdmcreate->getHandler('modules')->getCount();
- if ( $countModules == 0 ) {
+ $modulesCount = $tdmcreate->getHandler('modules')->getCountModules();
+ if ( $modulesCount == 0 ) {
redirect_header('modules.php?op=new', 2, _AM_TDMCREATE_NOTMODULES );
}
- unset($countModules);
+ unset($modulesCount);
// Redirect if there aren't tables
- $handlerTables = $tdmcreate->getHandler('tables');
- $countTables = $handlerTables->getCount();
- if ($countTables == 0) {
+ $tablesCount = $tdmcreate->getHandler('tables')->getCountTables();
+ if ($tablesCount == 0) {
redirect_header('tables.php?op=new', 2, _AM_TDMCREATE_NOTTABLES );
}
- unset($countTables);
// Get the list of tables
- $criteria = new CriteriaCompo();
- $criteria->add(new Criteria('table_mid', $handlerTables->getVar('table_mid')));
- $criteria->setStart($start);
- $criteria->setLimit($limit);
- $criteria->setSort('table_id ASC, table_order ASC, table_name');
- $criteria->setOrder('ASC');
- $countTables = $tdmcreate->getHandler('tables')->getCount($criteria);
- $tablesAll = $tdmcreate->getHandler('tables')->getAll($criteria);
- unset($criteria);
- if ($countTables > 0)
+ $tablesAll = $tdmcreate->getHandler('tables')->getAllTables($start, $limit);
+ if ($tablesCount > 0)
{
$tlid = 1;
foreach (array_keys($tablesAll) as $tid)
- {
+ {
// Display tables list
- $table['id'] = $tid;
- $table['lid'] = $tlid;
- $table['mid'] = $tablesAll[$tid]->getVar('table_mid');
- $table['name'] = ucfirst($tablesAll[$tid]->getVar('table_name'));
- $table['image'] = $tablesAll[$tid]->getVar('table_image');
- $table['nbfields'] = $tablesAll[$tid]->getVar('table_nbfields');
- $table['order'] = $tablesAll[$tid]->getVar('table_order');
- $table['autoincrement'] = $tablesAll[$tid]->getVar('table_autoincrement');
- $table['blocks'] = $tablesAll[$tid]->getVar('table_blocks');
- $table['admin'] = $tablesAll[$tid]->getVar('table_admin');
- $table['user'] = $tablesAll[$tid]->getVar('table_user');
- $table['search'] = $tablesAll[$tid]->getVar('table_search');
+ $table = $tablesAll[$tid]->getValues();
+ $talid = array('lid' => $tlid);
+ $table = array_merge($table, $talid);
// Get the list of fields
- $criteria = new CriteriaCompo();
- $criteria->add(new Criteria('field_mid', $table['mid']));
- $criteria->add(new Criteria('field_tid', $tid));
- $criteria->setSort('field_order ASC, field_id ASC, field_name');
- $criteria->setOrder('ASC');
- $countFields = $tdmcreate->getHandler('fields')->getCount($criteria);
- $fieldsAll = $tdmcreate->getHandler('fields')->getObjects($criteria);
- unset($criteria);
+ $fieldsCount = $tdmcreate->getHandler('fields')->getCountFields();
+ $fieldsAll = $tdmcreate->getHandler('fields')->getAllFieldsByModuleAndTableId($table['mid'], $tid);
// Display fields list
$fields = array();
$lid = 1;
- if ( $countFields > 0 )
+ if ( $fieldsCount > 0 )
{
- foreach (array_keys($fieldsAll) as $fid)
+ foreach (array_keys($fieldsAll) as $fid)
{
- $field['id'] = $fid;
- $field['lid'] = $lid;
- $field['order'] = $fieldsAll[$fid]->getVar('field_order');
- $field['name'] = str_replace('_', ' ', ucfirst($fieldsAll[$fid]->getVar('field_name')));
- $field['parent'] = $fieldsAll[$fid]->getVar('field_parent');
- $field['inlist'] = $fieldsAll[$fid]->getVar('field_inlist');
- $field['inform'] = $fieldsAll[$fid]->getVar('field_inform');
- $field['admin'] = $fieldsAll[$fid]->getVar('field_admin');
- $field['user'] = $fieldsAll[$fid]->getVar('field_user');
- $field['block'] = $fieldsAll[$fid]->getVar('field_block');
- $field['main'] = $fieldsAll[$fid]->getVar('field_main');
- $field['search'] = $fieldsAll[$fid]->getVar('field_search');
- $field['required'] = $fieldsAll[$fid]->getVar('field_required');
- $fields[] = $field;
- unset($field);
- $lid++;
+ $field = $fieldsAll[$fid]->getValues();
+ $falid = array('lid' => $lid);
+ $fields[] = array_merge($field, $falid);
+ unset($field);
+ ++$lid;
}
}
- $tlid++;
+ ++$tlid;
unset($lid);
$table['fields'] = $fields;
$GLOBALS['xoopsTpl']->append('tables_list', $table);
@@ -131,9 +95,9 @@
}
unset($tlid);
unset($fields);
- if ( $countTables > $limit ) {
+ if ( $tablesCount > $limit ) {
include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
- $pagenav = new XoopsPageNav($countTables, $limit, $start, 'start', 'op=list&limit=' . $limit);
+ $pagenav = new XoopsPageNav($tablesCount, $limit, $start, 'start', 'op=list&limit=' . $limit);
$GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4));
}
} else {
@@ -278,26 +242,50 @@
break;
case 'display':
- // Fields Handler
- $fields = $tdmcreate->getHandler('fields');
- //
- foreach ($_POST['field_id'] as $key => $value) {
- $fieldsObj =& $fields->get($value);
- $fieldsObj->setVar('field_parent', (1 == $_REQUEST['field_parent'][$key]) ? 0 : 1);
- $fieldsObj->setVar('field_inlist', (1 == $_REQUEST['field_inlist'][$key]) ? 0 : 1);
- $fieldsObj->setVar('field_inform', (1 == $_REQUEST['field_inform'][$key]) ? 0 : 1);
- $fieldsObj->setVar('field_admin', (1 == $_REQUEST['field_admin'][$key]) ? 0 : 1);
- $fieldsObj->setVar('field_user', (1 == $_REQUEST['field_user'][$key]) ? 0 : 1);
- $fieldsObj->setVar('field_block', (1 == $_REQUEST['field_block'][$key]) ? 0 : 1);
- $fieldsObj->setVar('field_main', ($key == $_REQUEST['field_main']) ? 0 : 1);
- $fieldsObj->setVar('field_search', (1 == $_REQUEST['field_search'][$key]) ? 0 : 1);
- $fieldsObj->setVar('field_required', (1 == $_REQUEST['field_required'][$key]) ? 0 : 1);
- }
- if ($fieldsObj->insert($fieldsObj, true)) {
- redirect_header('fields.php', 3, _AM_TDMCREATE_TOGGLE_SUCCESS);
- } else {
- redirect_header('fields.php', 3, _AM_TDMCREATE_TOGGLE_FAILED);
- }
+ $fieldId = tdmcreate_CleanVars($_POST, 'field_id', 0, 'int');
+ if ($fieldId > 0) {
+ $fieldsObj = $tdmcreate->getHandler('fields')->get($fieldId);
+ if (isset($_POST['field_parent'])) {
+ $field_parent = $fieldsObj->getVar('field_parent');
+ $fieldsObj->setVar('field_parent', !$field_parent);
+ }
+ if (isset($_POST['field_inlist'])) {
+ $field_inlist = $fieldsObj->getVar('field_inlist');
+ $fieldsObj->setVar('field_inlist', !$field_inlist);
+ }
+ if (isset($_POST['field_inform'])) {
+ $field_inform = $fieldsObj->getVar('field_inform');
+ $fieldsObj->setVar('field_inform', !$field_inform);
+ }
+ if (isset($_POST['field_admin'])) {
+ $field_admin = $fieldsObj->getVar('field_admin');
+ $fieldsObj->setVar('field_admin', !$field_admin);
+ }
+ if (isset($_POST['field_user'])) {
+ $field_user = $fieldsObj->getVar('field_user');
+ $fieldsObj->setVar('field_user', !$field_user);
+ }
+ if (isset($_POST['field_block'])) {
+ $field_block = $fieldsObj->getVar('field_block');
+ $fieldsObj->setVar('field_block', !$field_block);
+ }
+ if (isset($_POST['field_main'])) {
+ $field_main = $fieldsObj->getVar('field_main');
+ $fieldsObj->setVar('field_main', !$field_main);
+ }
+ if (isset($_POST['field_search'])) {
+ $field_search = $fieldsObj->getVar('field_search');
+ $fieldsObj->setVar('field_search', !$field_search);
+ }
+ if (isset($_POST['field_required'])) {
+ $field_required = $fieldsObj->getVar('field_required');
+ $fieldsObj->setVar('field_required', !$field_required);
+ }
+ if ($tdmcreate->getHandler('fields')->insert($fieldsObj)) {
+ redirect_header('fields.php', 3, _AM_TDMCREATE_TOGGLE_SUCCESS);
+ }
+ $GLOBALS['xoopsTpl']->assign('error', $fieldsObj->getHtmlErrors());
+ }
break;
}
include __DIR__ . '/footer.php';
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/modules.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/modules.php 2015-05-30 10:15:43 UTC (rev 13073)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/modules.php 2015-06-01 11:22:57 UTC (rev 13074)
@@ -40,40 +40,22 @@
$GLOBALS['xoopsTpl']->assign('tdmc_upload_imgmod_url', TDMC_UPLOAD_IMGMOD_URL);
$GLOBALS['xoopsTpl']->assign('modPathIcon16', $modPathIcon16);
$GLOBALS['xoopsTpl']->assign('sysPathIcon32', $sysPathIcon32);
- $criteria = new CriteriaCompo();
- $criteria->setStart($start);
- $criteria->setLimit($limit);
- $criteria->setSort('mod_id ASC, mod_name');
- $criteria->setOrder('ASC');
- $nb_modules = $tdmcreate->getHandler('modules')->getCount($criteria);
- $mods_arr = $tdmcreate->getHandler('modules')->getAll($criteria);
- unset($criteria);
+ $modulesCount = $tdmcreate->getHandler('modules')->getCountModules();
+ $modulesAll = $tdmcreate->getHandler('modules')->getAllModules($start, $limit);
// Redirect if there aren't modules
- if (0 == $nb_modules) {
+ if (0 == $modulesCount) {
redirect_header('modules.php?op=new', 2, _AM_TDMCREATE_NOTMODULES);
}
// Display modules list
- if ($nb_modules > 0) {
- foreach (array_keys($mods_arr) as $i) {
- $mod['id'] = $i;
- $mod['name'] = $mods_arr[$i]->getVar('mod_name');
- $mod['version'] = $mods_arr[$i]->getVar('mod_version');
- $mod['image'] = $mods_arr[$i]->getVar('mod_image');
- $mod['release'] = $mods_arr[$i]->getVar('mod_release');
- $mod['status'] = $mods_arr[$i]->getVar('mod_status');
- $mod['admin'] = $mods_arr[$i]->getVar('mod_admin');
- $mod['user'] = $mods_arr[$i]->getVar('mod_user');
- $mod['blocks'] = $mods_arr[$i]->getVar('mod_blocks');
- $mod['search'] = $mods_arr[$i]->getVar('mod_search');
- $mod['comments'] = $mods_arr[$i]->getVar('mod_comments');
- $mod['notifications'] = $mods_arr[$i]->getVar('mod_notifications');
- $mod['permissions'] = $mods_arr[$i]->getVar('mod_permissions');
- $GLOBALS['xoopsTpl']->append('modules_list', $mod);
- unset($mod);
+ if ($modulesCount > 0) {
+ foreach (array_keys($modulesAll) as $i) {
+ $module = $modulesAll[$i]->getValues();
+ $GLOBALS['xoopsTpl']->append('modules_list', $module);
+ unset($module);
}
- if ($nb_modules > $limit) {
+ if ($modulesCount > $limit) {
include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
- $pagenav = new XoopsPageNav($nb_modules, $limit, $start, 'start', 'op=list&limit=' . $limit);
+ $pagenav = new XoopsPageNav($modulesCount, $limit, $start, 'start', 'op=list&limit=' . $limit);
$GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4));
}
} else {
@@ -205,48 +187,44 @@
}
break;
- case 'display':
- //if ( $modId > 0 ) {
- $mod_admin = XoopsRequest::getInt('mod_admin');
- $mod_user = XoopsRequest::getInt('mod_user');
- $mod_blocks = XoopsRequest::getInt('mod_blocks');
- $mod_search = XoopsRequest::getInt('mod_search');
- $mod_comments = XoopsRequest::getInt('mod_comments');
- $mod_notifications = XoopsRequest::getInt('mod_notifications');
- $mod_permissions = XoopsRequest::getInt('mod_permissions');
-
- //foreach($_POST['mod_id'] as $key => $value)
- //{
- /*$mod_admin = tdmcreate_CleanVars($_REQUEST, 'mod_admin');
- $mod_user = tdmcreate_CleanVars($_REQUEST, 'mod_user');
- $mod_blocks = tdmcreate_CleanVars($_REQUEST, 'mod_blocks');
- $mod_search = tdmcreate_CleanVars($_REQUEST, 'mod_search');
- $mod_comments = tdmcreate_CleanVars($_REQUEST, 'mod_comments');
- $mod_notifications = tdmcreate_CleanVars($_REQUEST, 'mod_notifications');
- $mod_permissions = tdmcreate_CleanVars($_REQUEST, 'mod_permissions'); */
-
- $modulesObj =& $tdmcreate->getHandler('modules')->get($modId);
- if (isset($mod_admin)) {
- $modulesObj->setVar('mod_admin', $mod_admin);
- } elseif (isset($mod_user)) {
- $modulesObj->setVar('mod_user', $mod_user);
- } elseif (isset($mod_blocks)) {
- $modulesObj->setVar('mod_blocks', $mod_blocks);
- } elseif (isset($mod_search)) {
- $modulesObj->setVar('mod_search', $mod_search);
- } elseif (isset($mod_comments)) {
- $modulesObj->setVar('mod_comments', $mod_comments);
- } elseif (isset($mod_notifications)) {
- $modulesObj->setVar('mod_notifications', $mod_notifications);
- } elseif (isset($mod_permissions)) {
- $modulesObj->setVar('mod_permissions', $mod_permissions);
- }
- if ($tdmcreate->getHandler('modules')->insert($modulesObj, true)) {
- redirect_header('modules.php', 1, _AM_TDMCREATE_TOGGLE_SUCCESS);
- } else {
- redirect_header('modules.php', 1, _AM_TDMCREATE_TOGGLE_FAILED);
- }
- //}
+ case 'display':
+ $id = tdmcreate_CleanVars($_POST, 'mod_id', 0, 'int');
+ if ($id > 0) {
+ $modulesObj = $tdmcreate->getHandler('modules')->get($id);
+ if (isset($_POST['mod_admin'])) {
+ $mod_admin = $modulesObj->getVar('mod_admin');
+ $modulesObj->setVar('mod_admin', !$mod_admin);
+ }
+ if (isset($_POST['mod_user'])) {
+ $mod_user = $modulesObj->getVar('mod_user');
+ $modulesObj->setVar('mod_user', !$mod_user);
+ }
+ if (isset($_POST['mod_blocks'])) {
+ $mod_blocks = $modulesObj->getVar('mod_blocks');
+ $modulesObj->setVar('mod_blocks', !$mod_blocks);
+ }
+ if (isset($_POST['mod_search'])) {
+ $mod_search = $modulesObj->getVar('mod_search');
+ $modulesObj->setVar('mod_search', !$mod_search);
+ }
+ if (isset($_POST['mod_comments'])) {
+ $mod_comments = $modulesObj->getVar('mod_comments');
+ $modulesObj->setVar('mod_comments', !$mod_comments);
+ }
+ if (isset($_POST['mod_notifications'])) {
+ $mod_notifications = $modulesObj->getVar('mod_notifications');
+ $modulesObj->setVar('mod_notifications', !$mod_notifications);
+ }
+ if (isset($_POST['mod_permissions'])) {
+ $mod_permissions = $modulesObj->getVar('mod_permissions');
+ $modulesObj->setVar('mod_permissions', !$mod_permissions);
+ }
+ if ($tdmcreate->getHandler('modules')->insert($modulesObj)) {
+ redirect_header('modules.php', 3, _AM_TDMCREATE_TOGGLE_SUCCESS);
+ }
+ $GLOBALS['xoopsTpl']->assign('error', $modulesObj->getHtmlErrors());
+ }
break;
}
+
include __DIR__ . '/footer.php';
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/tables.php 2015-05-30 10:15:43 UTC (rev 13073)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/tables.php 2015-06-01 11:22:57 UTC (rev 13074)
@@ -51,78 +51,45 @@
$GLOBALS['xoopsTpl']->assign('modPathIcon16', $modPathIcon16);
$GLOBALS['xoopsTpl']->assign('sysPathIcon32', $sysPathIcon32);
// Get the list of modules
- $criteria = new CriteriaCompo();
- $criteria->setStart($start);
- $criteria->setLimit($limit);
- $criteria->setSort('mod_id ASC, mod_name');
- $criteria->setOrder('ASC');
- $numbModules = $tdmcreate->getHandler('modules')->getCount($criteria);
+ $modulesCount = $tdmcreate->getHandler('modules')->getCountModules();
// Redirect if there aren't modules
- if (0 == $numbModules) {
+ if (0 == $modulesCount) {
redirect_header('modules.php?op=new', 10, _AM_TDMCREATE_NOTMODULES);
}
- $mods_arr = $tdmcreate->getHandler('modules')->getAll($criteria);
- unset($criteria);
- $numbTables = $tdmcreate->getHandler('tables')->getObjects(null);
+ $modulesAll = $tdmcreate->getHandler('modules')->getAllModules($start, $limit);
+ $tablesCount = $tdmcreate->getHandler('tables')->getObjects(null);
// Redirect if there aren't tables
- if (0 == $numbTables) {
+ if (0 == $tablesCount) {
redirect_header('tables.php?op=new', 10, _AM_TDMCREATE_NOTTABLES);
}
- unset($numbTables);
+ unset($tablesCount);
// Display modules list
- if ($numbModules > 0) {
- foreach (array_keys($mods_arr) as $i) {
- $mod['id'] = $i;
- $mod['name'] = $mods_arr[$i]->getVar('mod_name');
- $mod['image'] = $mods_arr[$i]->getVar('mod_image');
- $mod['admin'] = $mods_arr[$i]->getVar('mod_admin');
- $mod['user'] = $mods_arr[$i]->getVar('mod_user');
- $mod['blocks'] = $mods_arr[$i]->getVar('mod_blocks');
- $mod['search'] = $mods_arr[$i]->getVar('mod_search');
- $mod['comments'] = $mods_arr[$i]->getVar('mod_comments');
- $mod['notifications'] = $mods_arr[$i]->getVar('mod_notifications');
- $mod['permissions'] = $mods_arr[$i]->getVar('mod_permissions');
+ if ($modulesCount > 0) {
+ foreach (array_keys($modulesAll) as $i) {
+ $module = $modulesAll[$i]->getValues();
// Get the list of tables
- $criteria = new CriteriaCompo();
- $criteria->add(new Criteria('table_mid', $i));
- $criteria->setSort('table_order ASC, table_id ASC, table_name');
- $criteria->setOrder('ASC');
- $numbTables = $tdmcreate->getHandler('tables')->getCount($criteria);
- $tables_arr = $tdmcreate->getHandler('tables')->getAll($criteria);
- unset($criteria);
+ $tablesCount = $tdmcreate->getHandler('tables')->getCountTables();
+ $tablesAll = $tdmcreate->getHandler('tables')->getAllTablesByModuleId($i);
// Display tables list
$tables = array();
$lid = 1;
- if ($numbTables > 0) {
- foreach (array_keys($tables_arr) as $t) {
- $table['id'] = $t;
- $table['lid'] = $lid;
- $table['mid'] = $tables_arr[$t]->getVar('table_mid');
- $table['name'] = ucfirst($tables_arr[$t]->getVar('table_name'));
- $table['image'] = $tables_arr[$t]->getVar('table_image');
- $table['nbfields'] = $tables_arr[$t]->getVar('table_nbfields');
- $table['order'] = $tables_arr[$t]->getVar('table_order');
- $table['blocks'] = $tables_arr[$t]->getVar('table_blocks');
- $table['admin'] = $tables_arr[$t]->getVar('table_admin');
- $table['user'] = $tables_arr[$t]->getVar('table_user');
- $table['submenu'] = $tables_arr[$t]->getVar('table_submenu');
- $table['search'] = $tables_arr[$t]->getVar('table_search');
- $table['comments'] = $tables_arr[$t]->getVar('table_comments');
- $table['notifications'] = $tables_arr[$t]->getVar('table_notifications');
- $table['permissions'] = $tables_arr[$t]->getVar('table_permissions');
- $tables[] = $table;
- unset($table);
+ if ($tablesCount > 0) {
+ foreach (array_keys($tablesAll) as $t) {
+ $table = $tablesAll[$t]->getValues();
+ $alid = array('lid' => $lid);
+ $tables[] = array_merge($table, $alid);
+ unset($table);
++$lid;
}
}
unset($lid);
- $mod['tables'] = $tables;
- $GLOBALS['xoopsTpl']->append('modules_list', $mod);
- unset($mod);
+ $module['tables'] = $tables;
+ $GLOBALS['xoopsTpl']->append('modules_list', $module);
+ unset($module);
}
- if ($numbModules > $limit) {
+ if ($modulesCount > $limit) {
include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
- $pagenav = new XoopsPageNav($numbModules, $limit, $start, 'start', 'op=list&limit=' . $limit);
+ $pagenav = new XoopsPageNav($modulesCount, $limit, $start, 'start', 'op=list&limit=' . $limit);
$GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4));
}
} else {
@@ -155,11 +122,11 @@
// Checking if table name exist in the same module
$criteria = new CriteriaCompo();
$criteria->add(new Criteria('table_mid', $tableMid));
- $table_name_search = $tables->getObjects($criteria);
+ $tableNameSearch = $tables->getObjects($criteria);
unset($criteria);
//unset($criteria);
- foreach (array_keys($table_name_search) as $t) {
- if ($table_name_search[$t]->getVar('table_name') === $_POST['table_name']) {
+ foreach (array_keys($tableNameSearch) as $t) {
+ if ($tableNameSearch[$t]->getVar('table_name') === $_POST['table_name']) {
redirect_header('tables.php?op=new', 3, sprintf(_AM_TDMCREATE_ERROR_TABLE_NAME_EXIST, $_POST['table_name']));
}
}
@@ -194,7 +161,8 @@
}
$tablesObj->setVars(array(
'table_autoincrement' => ((1 == $_REQUEST['table_autoincrement']) ? 1 : 0),
- 'table_blocks' => ((1 == $_REQUEST['table_blocks']) ? 1 : 0),
+ 'table_index' => ((1 == $_REQUEST['table_index']) ? 1 : 0),
+ 'table_blocks' => ((1 == $_REQUEST['table_blocks']) ? 1 : 0),
'table_admin' => ((1 == $_REQUEST['table_admin']) ? 1 : 0),
'table_user' => ((1 == $_REQUEST['table_user']) ? 1 : 0),
'table_submenu' => ((1 == $_REQUEST['table_submenu']) ? 1 : 0),
@@ -278,47 +246,80 @@
}
break;
- case 'display_modules':
- $modules = $tdmcreate->getHandler('modules');
- foreach ($_POST['mod_id'] as $key => $value) {
- if ($key > 0) {
- $modulesObj =& $tdmcreate->getHandler('modules')->get($value);
- $modulesObj->setVar('mod_admin', (1 == $_REQUEST['mod_admin'][$key]) ? 0 : 1);
- $modulesObj->setVar('mod_user', (1 == $_REQUEST['mod_user'][$key]) ? 0 : 1);
- $modulesObj->setVar('mod_blocks', (1 == $_REQUEST['mod_blocks'][$key]) ? 0 : 1);
- $modulesObj->setVar('mod_search', (1 == $_REQUEST['mod_search'][$key]) ? 0 : 1);
- $modulesObj->setVar('mod_comments', (1 == $_REQUEST['mod_comments'][$key]) ? 0 : 1);
- $modulesObj->setVar('mod_notifications', (1 == $_REQUEST['mod_notifications'][$key]) ? 0 : 1);
- $modulesObj->setVar('mod_permissions', (1 == $_REQUEST['mod_permissions'][$key]) ? 0 : 1);
+ case 'display':
+ $modId = tdmcreate_CleanVars($_POST, 'mod_id', 0, 'int');
+ if ($modId > 0) {
+ $modulesObj = $tdmcreate->getHandler('modules')->get($modId);
+ if (isset($_POST['mod_admin'])) {
+ $mod_admin = $modulesObj->getVar('mod_admin');
+ $modulesObj->setVar('mod_admin', !$mod_admin);
+ }
+ if (isset($_POST['mod_user'])) {
+ $mod_user = $modulesObj->getVar('mod_user');
+ $modulesObj->setVar('mod_user', !$mod_user);
+ }
+ if (isset($_POST['mod_blocks'])) {
+ $mod_blocks = $modulesObj->getVar('mod_blocks');
+ $modulesObj->setVar('mod_blocks', !$mod_blocks);
+ }
+ if (isset($_POST['mod_search'])) {
+ $mod_search = $modulesObj->getVar('mod_search');
+ $modulesObj->setVar('mod_search', !$mod_search);
+ }
+ if (isset($_POST['mod_comments'])) {
+ $mod_comments = $modulesObj->getVar('mod_comments');
+ $modulesObj->setVar('mod_comments', !$mod_comments);
+ }
+ if (isset($_POST['mod_notifications'])) {
+ $mod_notifications = $modulesObj->getVar('mod_notifications');
+ $modulesObj->setVar('mod_notifications', !$mod_notifications);
+ }
+ if (isset($_POST['mod_permissions'])) {
+ $mod_permissions = $modulesObj->getVar('mod_permissions');
+ $modulesObj->setVar('mod_permissions', !$mod_permissions);
+ }
+ if ($tdmcreate->getHandler('modules')->insert($modulesObj)) {
+ redirect_header('modules.php', 3, _AM_TDMCREATE_TOGGLE_SUCCESS);
}
+ $GLOBALS['xoopsTpl']->assign('error', $modulesObj->getHtmlErrors());
}
- if ($modules->insert($modulesObj, true)) {
- redirect_header('modules.php', 1, _AM_TDMCREATE_TOGGLE_SUCCESS);
- } else {
- redirect_header('modules.php', 1, _AM_TDMCREATE_TOGGLE_FAILED);
- }
- break;
-
- case 'display_tables':
- $tables = $tdmcreate->getHandler('tables');
- //
- foreach ($_POST['table_id'] as $key => $value) {
- if ($key > 0) {
- $tablesObj =& $tables->get($value);
- $tablesObj->setVar('table_admin', (1 == $_REQUEST['table_admin'][$key]) ? 0 : 1);
- $tablesObj->setVar('table_user', (1 == $_REQUEST['table_user'][$key]) ? 0 : 1);
- $tablesObj->setVar('table_blocks', (1 == $_REQUEST['table_blocks'][$key]) ? 0 : 1);
- $tablesObj->setVar('table_submenu', (1 == $_REQUEST['table_submenu'][$key]) ? 0 : 1);
- $tablesObj->setVar('table_search', (1 == $_REQUEST['table_search'][$key]) ? 0 : 1);
- $tablesObj->setVar('table_comme...
[truncated message content] |