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/branches/timgno/1.91a2/tdmcreate/class/files/admin/objects.php 2015-04-28 21:55:41 UTC (rev 13050) @@ -1,246 +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_objects.php 12258 2014-01-02 09:33:29Z timgno $ - */ -defined('XOOPS_ROOT_PATH') or die('Restricted access'); - -class AdminObjects -{ - /* - * @static function &getInstance - * @param null - */ - public static function &getInstance() - { - static $instance = false; - if (!$instance) { - $instance = new self(); - } - return $instance; - } - /* - * @public function getSimpleSetVar - * @param string $tableName - * @param string $fieldName - */ - public function getSimpleSetVar($tableName, $fieldName) { - $ret = <<<EOT - // Set Var {$fieldName} - \${$tableName}Obj->setVar('{$fieldName}', \$_POST['{$fieldName}']);\n -EOT; - return $ret; - } - /* - * @public function getTextDateSelectSetVar - * @param string $tableName - * @param string $fieldName - */ - public function getTextDateSelectSetVar($tableName, $fieldName) { - $ret = <<<EOT - // Set Var {$fieldName} - \${$tableName}Obj->setVar('{$fieldName}', strtotime(\$_POST['{$fieldName}']));\n -EOT; - return $ret; - } - /* - * @public function getCheckBoxOrRadioYNSetVar - * @param string $tableName - * @param string $fieldName - */ - public function getCheckBoxOrRadioYNSetVar($tableName, $fieldName) { - $ret = <<<EOT - // Set Var {$fieldName} - \${$tableName}Obj->setVar('{$fieldName}', ((\$_REQUEST['{$fieldName}'] == 1) ? '1' : '0'));\n -EOT; - return $ret; - } - /* - * @public function getImageListSetVar - * @param string $moduleDirname - * @param string $tableName - * @param string $fieldName - */ - public function getImageListSetVar($moduleDirname, $tableName, $fieldName) { - $ret = <<<EOT - // Set Var {$fieldName} - include_once XOOPS_ROOT_PATH.'/class/uploader.php'; - \$uploaddir = XOOPS_ROOT_PATH . '/Frameworks/moduleclasses/icons/32'; - \$uploader = new XoopsMediaUploader(\$uploaddir, \${$moduleDirname}->getConfig('mimetypes'), - \${$moduleDirname}->getConfig('maxsize'), null, null); - if (\$uploader->fetchMedia(\$_POST['xoops_upload_file'][0])) { - //\$uploader->setPrefix('{$fieldName}_'); - //\$uploader->fetchMedia(\$_POST['xoops_upload_file'][0]); - if (!\$uploader->upload()) { - \$errors = \$uploader->getErrors(); - redirect_header('javascript:history.go(-1)', 3, \$errors); - } else { - \${$tableName}Obj->setVar('{$fieldName}', \$uploader->getSavedFileName()); - } - } else { - \${$tableName}Obj->setVar('{$fieldName}', \$_POST['{$fieldName}']); - }\n -EOT; - return $ret; - } - /* - * @public function getUploadImageSetVar - * @param string $moduleDirname - * @param string $tableName - * @param string $fieldName - */ - public function getUploadImageSetVar($moduleDirname, $tableName, $fieldName) { - $stuModuleDirname = strtoupper($moduleDirname); - $ret = <<<EOT - // Set Var {$fieldName} - include_once XOOPS_ROOT_PATH.'/class/uploader.php'; - \$uploaddir = {$stuModuleDirname}_UPLOAD_PATH.'/images/{$tableName}'; - \$uploader = new XoopsMediaUploader(\$uploaddir, \${$moduleDirname}->getConfig('mimetypes'), - \${$moduleDirname}->getConfig('maxsize'), null, null); - if (\$uploader->fetchMedia(\$_POST['xoops_upload_file'][0])) { - //\$uploader->setPrefix('{$fieldName}_'); - //\$uploader->fetchMedia(\$_POST['xoops_upload_file'][0]); - if (!\$uploader->upload()) { - \$errors = \$uploader->getErrors(); - redirect_header('javascript:history.go(-1)', 3, \$errors); - } else { - \${$tableName}Obj->setVar('{$fieldName}', \$uploader->getSavedFileName()); - } - } else { - \${$tableName}Obj->setVar('{$fieldName}', \$_POST['{$fieldName}']); - }\n -EOT; - return $ret; - } - /* - * @public function getUploadFileSetVar - * @param string $moduleDirname - * @param string $tableName - * @param string $fieldName - */ - public function getUploadFileSetVar($moduleDirname, $tableName, $fieldName) { - $stuModuleDirname = strtoupper($moduleDirname); - $ret = <<<EOT - // Set Var {$fieldName} - include_once XOOPS_ROOT_PATH.'/class/uploader.php'; - \$uploaddir = {$stuModuleDirname}_UPLOAD_PATH.'/files/{$tableName}'; - \$uploader = new XoopsMediaUploader(\$uploaddir, \${$moduleDirname}->getConfig('mimetypes'), - \${$moduleDirname}->getConfig('maxsize'), null, null); - if (\$uploader->fetchMedia(\$_POST['xoops_upload_file'][0])) { - //\$uploader->setPrefix('{$fieldName}_') ; - //\$uploader->fetchMedia(\$_POST['xoops_upload_file'][0]); - if (!\$uploader->upload()) { - \$errors = \$uploader->getErrors(); - redirect_header('javascript:history.go(-1)', 3, \$errors); - } else { - \${$tableName}Obj->setVar('{$fieldName}', \$uploader->getSavedFileName()); - } - }\n -EOT; - return $ret; - } - /* - * @public function getSimpleGetVar - * @param string $lpFieldName - * @param string $rpFieldName - * @param string $tableName - * @param string $fieldName - */ - public function getSimpleGetVar($lpFieldName, $rpFieldName, $tableName, $fieldName) { - $ret = <<<EOT -\t\t\t\t// Get Var {$fieldName} -\t\t\t\t\${$lpFieldName}['{$rpFieldName}'] = \${$tableName}_arr[\$i]->getVar('{$fieldName}');\n -EOT; - return $ret; - } - /* - * @public function getTopicGetVar - * @param string $lpFieldName - * @param string $rpFieldName - * @param string $tableName - * @param string $tableNameTopic - * @param string $fieldNameParent - * @param string $fieldNameTopic - */ - public function getTopicGetVar($lpFieldName, $rpFieldName, $tableName, $tableNameTopic, $fieldNameParent, $fieldNameTopic) { - $ret = <<<EOT -\t\t\t\t// Get Var {$fieldNameParent} -\t\t\t\t\${$rpFieldName} =& \${$tableNameTopic}Handler->get(\${$tableName}_arr[\$i]->getVar('{$fieldNameParent}')); -\t\t\t\t\${$lpFieldName}['{$rpFieldName}'] = \${$rpFieldName}->getVar('{$fieldNameTopic}');\n -EOT; - return $ret; - } - /* - * @public function getUploadImageGetVar - * @param string $lpFieldName - * @param string $rpFieldName - * @param string $tableName - * @param string $fieldName - */ - public function getUploadImageGetVar($lpFieldName, $rpFieldName, $tableName, $fieldName) { - $ret = <<<EOT -\t\t\t\t// Get Var {$fieldName} -\t\t\t\t\${$fieldName} = \${$tableName}_arr[\$i]->getVar('{$fieldName}'); -\t\t\t\t\$upload_image = \${$fieldName} ? \${$fieldName} : 'blank.gif'; -\t\t\t\t\${$lpFieldName}['{$rpFieldName}'] = \$upload_image;\n -EOT; - return $ret; - } - /* - * @public function getTextAreaGetVar - * @param string $lpFieldName - * @param string $rpFieldName - * @param string $tableName - * @param string $fieldName - */ - public function getTextAreaGetVar($lpFieldName, $rpFieldName, $tableName, $fieldName) { - $ret = <<<EOT -\t\t\t\t// Get Var {$fieldName} -\t\t\t\t\${$lpFieldName}['{$rpFieldName}'] = strip_tags(\${$tableName}_arr[\$i]->getVar('{$fieldName}'));\n -EOT; - return $ret; - } - /* - * @public function getSelectUserGetVar - * @param string $lpFieldName - * @param string $rpFieldName - * @param string $tableName - * @param string $fieldName - */ - public function getSelectUserGetVar($lpFieldName, $rpFieldName, $tableName, $fieldName) { - $ret = <<<EOT -\t\t\t\t// Get Var {$fieldName} -\t\t\t\t\${$lpFieldName}['{$rpFieldName}'] = XoopsUser::getUnameFromId(\${$tableName}_arr[\$i]->getVar('{$fieldName}'), 's');\n -EOT; - return $ret; - } - /* - * @public function getTextDateSelectGetVar - * @param string $lpFieldName - * @param string $rpFieldName - * @param string $tableName - * @param string $fieldName - */ - public function getTextDateSelectGetVar($lpFieldName, $rpFieldName, $tableName, $fieldName) { - $ret = <<<EOT -\t\t\t\t// Get Var {$fieldName} -\t\t\t\t\${$lpFieldName}['{$rpFieldName}'] = formatTimeStamp(\${$tableName}_arr[\$i]->getVar('{$fieldName}'), 's');\n -EOT; - return $ret; - } -} \ No newline at end of file Deleted: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/pages.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/pages.php 2015-04-28 16:44:18 UTC (rev 13049) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/pages.php 2015-04-28 21:55:41 UTC (rev 13050) @@ -1,380 +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: pages.php 12258 2014-01-02 09:33:29Z timgno $ - */ -defined('XOOPS_ROOT_PATH') or die('Restricted access'); -require_once 'objects.php'; -class AdminPages extends TDMCreateFile -{ - /* - * @var string - */ - private $adminobjects = null; - /* - * @public function constructor - * @param null - */ - public function __construct() { - parent::__construct(); - $this->adminobjects = AdminObjects::getInstance(); - $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 $table - */ - public function write($module, $table) { - $this->setModule($module); - $this->setTable($table); - } - /* - * @public function getAdminPagesHeader - * @param string $moduleDirname - * @param string $tableName - */ - public function getAdminPagesHeader($moduleDirname, $table, $fpif) { - - $ret = <<<EOT -include_once 'header.php'; -//It recovered the value of argument op in URL$ -\$op = XoopsRequest::getString('op', 'list'); -// Request {$fpif} -\${$fpif} = XoopsRequest::getInt('{$fpif}'); -// Switch options -switch (\$op) -{\n -EOT; - return $ret; - } - - /* - * @public function getAdminPagesList - * @param string $moduleDirname - * @param string $table - * @param string $tableFieldname - * @param string $language - * @param string $fields - * @param string $fpif - * @param string $fpmf - */ - public function getAdminPagesList($moduleDirname, $table, $tableFieldname, $language, $fields, $fpif, $fpmf) { - $stuModuleDirname = strtoupper($moduleDirname); - $tableName = $table->getVar('table_name'); - $tableAutoincrement = $table->getVar('table_autoincrement'); - $stuTableName = strtoupper($tableName); - $stuTableFieldname = strtoupper($tableFieldname); - $ret = <<<EOT - case 'list': - default: - \$start = XoopsRequest::getInt('start', 0); - \$limit = XoopsRequest::getInt('limit', \${$moduleDirname}->getConfig('adminpager')); - \$template_main = '{$moduleDirname}_admin_{$tableName}.tpl'; - \$GLOBALS['xoopsTpl']->assign('navigation', \$adminMenu->addNavigation('{$tableName}.php')); - \$adminMenu->addItemButton({$language}ADD_{$stuTableFieldname}, '{$tableName}.php?op=new', 'add'); - \$GLOBALS['xoopsTpl']->assign('buttons', \$adminMenu->renderButton()); - \$criteria = new CriteriaCompo(); - \$criteria->setSort('{$fpif} ASC, {$fpmf}'); - \$criteria->setOrder('ASC'); - \${$tableName}_rows = \${$tableName}Handler->getCount(\$criteria); - \${$tableName}_arr = \${$tableName}Handler->getAll(\$criteria); - unset(\$criteria); - \$GLOBALS['xoopsTpl']->assign('{$moduleDirname}_url', {$stuModuleDirname}_URL); - \$GLOBALS['xoopsTpl']->assign('{$moduleDirname}_upload_url', {$stuModuleDirname}_UPLOAD_URL); - // Table view - if (\${$tableName}_rows > 0) - { - foreach (array_keys(\${$tableName}_arr) as \$i) - {\n -EOT; - foreach(array_keys($fields) as $f) - { - $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; - $rpFieldName = $this->tdmcfile->getRightString($fieldName); - // - $fieldElement = $fields[$f]->getVar('field_element'); - if( ($fields[$f]->getVar('field_admin') == 1) || ($tableAutoincrement == 1) ) { - switch($fieldElement) { - case 3: - case 4: - $ret .= $this->adminobjects->getTextAreaGetVar($lpFieldName, $rpFieldName, $tableName, $fieldName); - break; - case 8: - $ret .= $this->adminobjects->getSelectUserGetVar($lpFieldName, $rpFieldName, $tableName, $fieldName); - break; - case 11: - $ret .= $this->adminobjects->getUploadImageGetVar($lpFieldName, $rpFieldName, $tableName, $fieldName); - break; - case 13: - $ret .= $this->adminobjects->getTextDateSelectGetVar($lpFieldName, $rpFieldName, $tableName, $fieldName); - break; - default: - if( ($fieldParent == 1) && !$table->getVar('table_category') ) { - if($fieldElement > 13) { - $fieldElements = $this->tdmcreate->getHandler('fieldelements')->get($fieldElement); - $fieldElementTid = $fieldElements->getVar('fieldelement_tid'); - $fieldElementName = $fieldElements->getVar('fieldelement_name'); - $rpFieldElementName = strtolower(str_replace('Table : ', '', $fieldElementName)); - } - // - $fieldNameParent = $fieldName; - // - $criteriaFieldsTopic = new CriteriaCompo(); - $criteriaFieldsTopic->add(new Criteria('field_tid', $fieldElementTid)); - $fieldsTopic = $this->tdmcreate->getHandler('fields')->getObjects($criteriaFieldsTopic); - unset($criteriaFieldsTopic); - foreach(array_keys($fieldsTopic) as $ft) - { - if( $fieldsTopic[$ft]->getVar('field_main') == 1 ) { - $fieldNameTopic = $fieldsTopic[$ft]->getVar('field_name'); - } - } - $ret .= $this->adminobjects->getTopicGetVar($lpFieldName, $rpFieldName, $tableName, $rpFieldElementName, $fieldNameParent, $fieldNameTopic); - } else { - $ret .= $this->adminobjects->getSimpleGetVar($lpFieldName, $rpFieldName, $tableName, $fieldName); - } - break; - } - } - } - $ret .= <<<EOT - \$GLOBALS['xoopsTpl']->append('{$tableName}_list', \${$lpFieldName}); - unset(\${$lpFieldName}); - }\n -EOT; - $ret .= <<<EOT - if ( \${$tableName}_rows > \$limit ) { - include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; - \$pagenav = new XoopsPageNav(\${$tableName}_rows, \$limit, \$start, 'start', 'op=list&limit=' . \$limit); - \$GLOBALS['xoopsTpl']->assign('pagenav', \$pagenav->renderNav(4)); - } - } else { - \$GLOBALS['xoopsTpl']->assign('error', {$language}THEREARENT_{$stuTableName}); - } - break;\n -EOT; - return $ret; - } - - /* - * @public function getAdminPagesNew - * @param string $moduleDirname - * @param string $tableName - * @param string $language - */ - public function getAdminPagesNew($moduleDirname, $tableName, $language) { - $stuTableName = strtoupper($tableName); - $ret = <<<EOT - case 'new': - \$template_main = '{$moduleDirname}_admin_{$tableName}.tpl'; - \$adminMenu->addItemButton({$language}{$stuTableName}_LIST, '{$tableName}.php', 'list'); - \$GLOBALS['xoopsTpl']->assign('navigation', \$adminMenu->addNavigation('{$tableName}.php')); - \$GLOBALS['xoopsTpl']->assign('buttons', \$adminMenu->renderButton()); - // Get Form - \${$tableName}Obj =& \${$tableName}Handler->create(); - \$form = \${$tableName}Obj->getForm(); - \$GLOBALS['xoopsTpl']->assign('form', \$form->render()); - break;\n -EOT; - return $ret; - } - - /* - * @public function getAdminPagesSave - * @param string $moduleDirname - * @param string $tableName - * @param string $language - * @param string $fields - * @param string $fpif - * @param string $fpmf - */ - public function getAdminPagesSave($moduleDirname, $tableName, $language, $fields, $fpif, $fpmf) - { - $ret = <<<EOT - case 'save': - if ( !\$GLOBALS['xoopsSecurity']->check() ) { - redirect_header('{$tableName}.php', 3, implode(',', \$GLOBALS['xoopsSecurity']->getErrors())); - } - if (isset(\${$fpif})) { - \${$tableName}Obj =& \${$tableName}Handler->get(\${$fpif}); - } else { - \${$tableName}Obj =& \${$tableName}Handler->create(); - } - // 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 10: - $ret .= $this->adminobjects->getImageListSetVar($moduleDirname, $tableName, $fieldName); - break; - case 11: - $ret .= $this->adminobjects->getUploadImageSetVar($moduleDirname, $tableName, $fieldName); - break; - case 12: - $ret .= $this->adminobjects->getUploadFileSetVar($moduleDirname, $tableName, $fieldName); - break; - case 13: - $ret .= $this->adminobjects->getTextDateSelectSetVar($tableName, $fieldName); - break; - default: - $ret .= $this->adminobjects->getSimpleSetVar($tableName, $fieldName); - break; - } - } - } - - $ret .= <<<EOT - // Insert Data - if (\${$tableName}Handler->insert(\${$tableName}Obj)) { - redirect_header('{$tableName}.php?op=list', 2, {$language}FORMOK); - } - // Get Form - \$GLOBALS['xoopsTpl']->assign('error', \${$tableName}Obj->getHtmlErrors()); - \$form =& \${$tableName}Obj->getForm(); - \$GLOBALS['xoopsTpl']->assign('form', \$form->render()); - break;\n -EOT; - return $ret; - } - - /* - * @public function getAdminPagesEdit - * @param string $moduleDirname - * @param string $tableName - * @param string $tableFieldname - * @param string $language - * @param string $fpif - */ - public function getAdminPagesEdit($moduleDirname, $tableName, $tableFieldname, $language, $fpif) { - $stuTableName = strtoupper($tableName); - $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}{$stuTableName}_LIST, '{$tableName}.php', 'list'); - \$GLOBALS['xoopsTpl']->assign('navigation', \$adminMenu->addNavigation('{$tableName}.php')); - \$GLOBALS['xoopsTpl']->assign('buttons', \$adminMenu->renderButton()); - // Get Form - \${$tableName}Obj = \${$tableName}Handler->get(\${$fpif}); - \$form = \${$tableName}Obj->getForm(); - \$GLOBALS['xoopsTpl']->assign('form', \$form->render()); - break;\n -EOT; - return $ret; - } - - /* - * @public function getAdminPagesDelete - * @param string $tableName - * @param string $language - */ - public function getAdminPagesDelete($tableName, $language, $fpif, $fpmf) { - - $ret = <<<EOT - case 'delete': - \${$tableName}Obj =& \${$tableName}Handler->get(\${$fpif}); - if (isset(\$_REQUEST['ok']) && \$_REQUEST['ok'] == 1) { - 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, '{$fpif}' => \${$fpif}, 'op' => 'delete'), \$_SERVER['REQUEST_URI'], sprintf({$language}FORMSUREDEL, \${$tableName}Obj->getVar('{$fpmf}'))); - } - break;\n -EOT; - return $ret; - } - - /* - * @public function getAdminPagesFooter - * @param null - */ - public function getAdminPagesFooter() { - $ret = <<<EOT -} -include_once 'footer.php'; -EOT; - return $ret; - } - - /* - * @public function render - * @param null - */ - public function renderFile($filename) - { - $module = $this->getModule(); - $table = $this->getTable(); - $moduleDirname = $module->getVar('mod_dirname'); - $tableName = $table->getVar('table_name'); - $tableFieldname = $table->getVar('table_fieldname'); - $language = $this->getLanguage($moduleDirname, 'AM'); - $fields = $this->getTableFields($table->getVar('table_id')); - foreach(array_keys($fields) as $f) - { - $fieldName = $fields[$f]->getVar('field_name'); - if($f == 0) { - $fpif = $fieldName; - } - if($fields[$f]->getVar('field_main') == 1) { - $fpmf = $fieldName; - } - } - $content = $this->getHeaderFilesComments($module, $filename); - $content .= $this->getAdminPagesHeader($moduleDirname, $tableName, $fpif); - $content .= $this->getAdminPagesList($moduleDirname, $table, $tableFieldname, $language, $fields, $fpif, $fpmf); - $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->getAdminPagesDelete($tableName, $language, $fpif, $fpmf); - $content .= $this->getAdminPagesFooter(); - // - $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/permissions.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/permissions.php 2015-04-28 16:44:18 UTC (rev 13049) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/permissions.php 2015-04-28 21:55:41 UTC (rev 13050) @@ -1,222 +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_permissions.php 12258 2014-01-02 09:33:29Z timgno $ - */ -defined('XOOPS_ROOT_PATH') or die('Restricted access'); - -class AdminPermissions 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 mixed $tables - * @param string $filename - */ - public function write($module, $tables, $filename) { - $this->setModule($module); - $this->setTables($tables); - $this->setFileName($filename); - } - /* - * @private function getPermissionsCodeHeader - * @param string $moduleDirname - * @param string $language - */ - private function getPermissionsCodeHeader($moduleDirname, $language) - { - $ret = <<<PRM -\ninclude_once 'header.php'; -include_once XOOPS_ROOT_PATH.'/class/xoopsform/grouppermform.php'; -if( !empty(\$_POST['submit']) ) -{ - redirect_header( XOOPS_URL.'/modules/'.\$xoopsModule->dirname().'/admin/permissions.php', 1, _MP_GPERMUPDATED ); -} -// Check admin have access to this page -/*\$group = \$xoopsUser->getGroups (); -\$groups = xoops_getModuleOption ( 'admin_groups', \$thisDirname ); -if (count ( array_intersect ( \$group, \$groups ) ) <= 0) { - redirect_header ( 'index.php', 3, _NOPERM ); -}*/ -\$template_main = '{$moduleDirname}_admin_permissions.tpl'; -echo \$adminMenu->addNavigation('permissions.php'); - -\$permission = {$moduleDirname}_CleanVars(\$_REQUEST, 'permission', 1, 'int'); -\$selected = array('', '', '', ''); -\$selected[\$permission-1] = ' selected'; -xoops_load('XoopsFormLoader'); -\$permTableForm = new XoopsSimpleForm('', 'fselperm', 'permissions.php', 'get'); -\$formSelect = new XoopsFormSelect('', 'permission', \$permission); -\$formSelect->setExtra('onchange="document.forms.fselperm.submit()"'); -\$formSelect->addOption(\$selected[0], {$language}GLOBAL); -\$formSelect->addOption(\$selected[1], {$language}APPROVE); -\$formSelect->addOption(\$selected[2], {$language}SUBMIT); -\$formSelect->addOption(\$selected[3], {$language}VIEW); -\$permTableForm->addElement(\$formSelect); -\$permTableForm->display();\n\n -PRM; - return $ret; - } - - /* - * @private function getPermissionsCodeSwitch - * @param string $moduleDirname - * @param string $language - */ - private function getPermissionsCodeSwitch($moduleDirname, $language) - { - $ret = <<<PRM -\$module_id = \$xoopsModule->getVar('mid'); -switch(\$permission) -{ - case 1: - \$formTitle = {$language}GLOBAL; - \$permName = '{$moduleDirname}_ac'; - \$permDesc = {$language}GLOBAL_DESC; - \$globalPerms = array( '4' => {$language}GLOBAL_4, - '8' => {$language}GLOBAL_8, - '16' => {$language}GLOBAL_16 ); - break; - case 2: - \$formTitle = {$language}APPROVE; - \$permName = '{$moduleDirname}_access'; - \$permDesc = {$language}APPROVE_DESC; - break; - case 3: - \$formTitle = {$language}SUBMIT; - \$permName = '{$moduleDirname}_submit'; - \$permDesc = {$language}SUBMIT_DESC; - break; - case 4: - \$formTitle = {$language}VIEW; - \$permName = '{$moduleDirname}_view'; - \$permDesc = {$language}VIEW_DESC; - break; -}\n -PRM; - return $ret; - } - - /* - * @private function getPermissionsCodeBody - * @param string $moduleDirname - * @param string $tableName - * @param string $language - */ - private function getPermissionsCodeBody($moduleDirname, $language) - { - $tables = $this->getTables(); - foreach(array_keys($tables) as $t) - { - $tableId = $tables[$t]->getVar('table_id'); - if($tables[$t]->getVar('table_permissions') == 1) { - $tableName = $tables[$t]->getVar('table_name'); - } - } - $fields = $this->getTableFields($tableId); - foreach(array_keys($fields) as $f) - { - if($f == 0) { - $fpif = $fields[$f]->getVar('field_name'); - } - if($fields[$f]->getVar('field_main') == 1) { - $fpmf = $fields[$f]->getVar('field_name'); - } - } - $ret = <<<PRM -\$permform = new XoopsGroupPermForm(\$formTitle, \$module_id, \$permName, \$permDesc, 'admin/permissions.php'); -if (\$permission == 1) { - foreach (\$globalPerms as \$perm_id => \$perm_name) { - \$permform->addItem(\$perm_id, \$perm_name); - } - echo \$permform->render(); - echo '<br /><br />'; -} else { - \$criteria = new CriteriaCompo(); - \$criteria->setSort('{$fpmf}'); - \$criteria->setOrder('ASC'); - \${$tableName}_count = \${$tableName}Handler->getCount(\$criteria); - \${$tableName}_arr = \${$tableName}Handler->getObjects(\$criteria); - unset(\$criteria); - foreach (array_keys(\${$tableName}_arr) as \$i) { - \$permform->addItem(\${$tableName}_arr[\$i]->getVar('{$fpif}'), \${$tableName}_arr[\$i]->getVar('{$fpmf}')); - } - // Check if {$tableName} exist before rendering the form and redirect, if there aren't {$tableName} - if (\${$tableName}_count > 0) { - echo \$permform->render(); - echo '<br /><br />'; - } else { - redirect_header ( '{$tableName}.php?op=new', 3, {$language}NOPERMSSET ); - exit (); - }\n -PRM; - return $ret; - } - - /* - * @private function getPermissionsCodeFooter - * @param null - */ - private function getPermissionsCodeFooter() { - $ret = <<<PRM -} -unset(\$permform); -include_once 'footer.php'; -PRM; - return $ret; - } - - /* - * @public function render - * @param null - */ - public function render() { - $module = $this->getModule(); - $filename = $this->getFileName(); - $moduleDirname = $module->getVar('mod_dirname'); - $language = $this->getLanguage($moduleDirname, 'AM'); - $content = $this->getHeaderFilesComments($module, $filename); - $content .= $this->getPermissionsCodeHeader($moduleDirname, $language); - $content .= $this->getPermissionsCodeSwitch($moduleDirname, $language); - $content .= $this->getPermissionsCodeBody($moduleDirname, $language); - ... [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_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'); // - if ( !$GLOBALS['xoopsSecurity']->check() ) { - redirect_header('fields.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors())); - } - $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(); - } - $order = $fieldsObj->isNew() ? $fieldOrder + 1 : $fieldOrder; - if (isset($fieldMid) && isset($fieldTid) && !empty($_POST['field_name'][$key])) { - // Set Data - $fieldsObj->setVar( 'field_mid', $fieldMid ); - $fieldsObj->setVar( 'field_tid', $fieldTid ); - $fieldsObj->setVar( 'field_numb', $fieldNumb ); - $fieldsObj->setVar( 'field_order', (isset($_POST['field_order'][$key]) ? $_POST['field_order'][$key] : $order) ); - $fieldsObj->setVar( 'field_name', (!empty($_POST['field_name'][$key]) ? $_POST['field_name'][$key] : '') ); - $fieldsObj->setVar( 'field_type', (!empty($_POST['field_type'][$key]) ? $_POST['field_type'][$key] : '') ); - $fieldsObj->setVar( 'field_value', (!empty($_POST['field_value'][$key]) ? $_POST['field_value'][$key] : '') ); - $fieldsObj->setVar( 'field_attribute', (!empty($_POST['field_attribute'][$key]) ? $_POST['field_attribute'][$key] : '') ); - $fieldsObj->setVar( 'field_null', (!empty($_POST['field_null'][$key]) ? $_POST['field_null'][$key] : '') ); - $fieldsObj->setVar( 'field_default', (!empty($_POST['field_default'][$key]) ? $_POST['field_default'][$key] : '') ); - $fieldsObj->setVar( 'field_key', (!empty($_POST['field_key'][$key]) ? $_POST['field_key'][$key] : '') ); - $fieldsObj->setVar( 'field_element', (!empty($_POST['field_element'][$key]) ? $_POST['field_element'][$key] : '') ); - $fieldsObj->setVar( 'field_parent', ((isset($_REQUEST['field_parent'][$key]) == 1) ? 1 : 0) ); - $fieldsObj->setVar( 'field_inlist', ((isset($_REQUEST['field_inlist'][$key]) == 1) ? 1 : 0) ); - $fieldsObj->setVar( 'field_inform', ((isset($_REQUEST['field_inform'][$key]) == 1) ? 1 : 0) ); - $fieldsObj->setVar( 'field_admin', ((isset($_REQUEST['field_admin'][$key]) == 1) ? 1 : 0) ); - $fieldsObj->setVar( 'field_user', ((isset($_REQUEST['field_user'][$key]) == 1) ? 1 : 0) ); - $fieldsObj->setVar( 'field_block', ((isset($_REQUEST['field_block'][$key]) == 1) ? 1 : 0) ); - $fieldsObj->setVar( 'field_main', (($key == $_REQUEST['field_main']) ? 1 : 0) ); - $fieldsObj->setVar( 'field_search', ((isset($_REQUEST['field_search'][$key]) == 1) ? 1 : 0) ); - $fieldsObj->setVar( 'field_required', ((isset($_REQUEST['field_required'][$key]) == 1) ? 1 : 0) ); - // Insert Data - $tdmcreate->getHandler('fields')->insert($fieldsObj); - } - $orderId++; - } - unset($orderId); - // 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)); - } + $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); + // 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)); + } // - $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, $fieldNumb); - $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']) && $_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(); - } + 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': + // 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_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); + } + if ($fieldsObj->insert($fieldsObj, true)) { + redirect_header('fields.php', 3, _AM_TDMCREATE_TOGGLE_SUCCESS); } else { - xoops_confirm(array('ok' => 1, 'field_tid' => $fieldTid, 'op' => 'delete'), $_SERVER['REQUEST_URI'], sprintf(_AM_TDMCREATE_FORMSUREDEL, $tablesObj->getVar('table_name'))); + redirect_header('fields.php', 3, _AM_TDMCREATE_TOGGLE_FAILED); } - break; - - case 'display': - // - $fields = $tdmcreate->getHandler('fields'); - // Fields Handler - foreach($_POST['field_id'] as $key => $value) - { - $fieldsObj =& $fields->get($value); - $fieldsObj->setVar( 'field_parent', ((isset($_REQUEST['field_parent'][$key]) == 1) ? 1 : 0) ); - $fieldsObj->setVar( 'field_inlist', ((isset($_REQUEST['field_inlist'][$key]) == 1) ? 1 : 0) ); - $fieldsObj->setVar( 'field_inform', ((isset($_REQUEST['field_inform'][$key]) == 1) ? 1 : 0) ); - $fieldsObj->setVar( 'field_admin', ((isset($_REQUEST['field_admin'][$key]) == 1) ? 1 : 0) ); - $fieldsObj->setVar( 'field_user', ((isset($_REQUEST['field_user'][$key]) == 1) ? 1 : 0) ); - $fieldsObj->setVar( 'field_block', ((isset($_REQUEST['field_block'][$key]) == 1) ? 1 : 0) ); - $fieldsObj->setVar( 'field_main', (($key == $_REQUEST['field_main']) ? 1 : 0) ); - $fieldsObj->setVar( 'field_search', ((isset($_REQUEST['field_search'][$key]) == 1) ? 1 : 0) ); - $fieldsObj->setVar( 'field_required', ((isset($_REQUEST['field_required'][$key]) == 1) ? 1 : 0) ); - if ($fieldsObj->insert($fieldsObj, true)) { - redirect_header('fields.php', 3, _AM_TDMCREATE_TOGGLE_SUCCESS); - } else { - redirect_header('fields.php', 3, _AM_TDMCREATE_TOGGLE_FAILED); - } - } - break; + 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/footer.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/footer.php 2015-04-28 21:55:41 UTC (rev 13050) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/footer.php 2015-05-01 16:05:55 UTC (rev 13051) @@ -19,8 +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) ) { +if (isset($template_main)) { $GLOBALS['xoopsTpl']->display("db:{$template_main}"); } xoops_cp_footer(); -?> \ No newline at end of file Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/header.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/header.php 2015-04-28 21:55:41 UTC (rev 13050) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/header.php 2015-05-01 16:05:55 UTC (rev 13051) @@ -17,25 +17,25 @@ * @since 2.5.0 * @author Txmod Xoops http://www.txmodxoops.org * @version $Id: header.php 12258 2014-01-02 09:33:29Z timgno $ -*/ -include_once dirname(dirname(dirname(dirname(__FILE__)))) . '/include/cp_header.php'; -include_once dirname(dirname(__FILE__)) . '/include/common.php'; + */ +include_once dirname(dirname(dirname(__DIR__))) . '/include/cp_header.php'; +include_once dirname(__DIR__) . '/include/common.php'; // $thisDirname = $GLOBALS['xoopsModule']->getVar('dirname'); // Link System Icons $sysPathIcon16 = $GLOBALS['xoopsModule']->getInfo('sysicons16'); $sysPathIcon32 = $GLOBALS['xoopsModule']->getInfo('sysicons32'); // Link Local Icons -$modPathIcon16 = $GLOBALS['xoopsModule']->getInfo('modicons16'); -$modPathIcon32 = $GLOBALS['xoopsModule']->getInfo('modicons32'); +$modPathIcon16 = $GLOBALS['xoopsModule']->getInfo('modicons16'); +$modPathIcon32 = $GLOBALS['xoopsModule']->getInfo('modicons32'); $pathModuleAdmin = $GLOBALS['xoopsModule']->getInfo('dirmoduleadmin'); // TDMCreate Instance $tdmcreate = TDMCreateHelper::getInstance(); // MyTextSanitizer $myts =& MyTextSanitizer::getInstance(); if (!isset($xoopsTpl) || !is_object($xoopsTpl)) { - include_once(XOOPS_ROOT_PATH."/class/template.php"); - $xoopsTpl = new XoopsTpl(); + include_once(XOOPS_ROOT_PATH . "/class/template.php"); + $xoopsTpl = new XoopsTpl(); } // System Icons $GLOBALS['xoopsTpl']->assign('sysPathIcon16', $sysPathIcon16); @@ -48,10 +48,10 @@ xoops_loadLanguage('modinfo', $thisDirname); xoops_loadLanguage('main', $thisDirname); // Locad admin menu class -if ( file_exists($GLOBALS['xoops']->path($pathModuleAdmin.'/moduleadmin.php'))){ - include_once $GLOBALS['xoops']->path($pathModuleAdmin.'/moduleadmin.php'); -}else{ - redirect_header("../../../admin.php", 5, _AM_MODULEADMIN_MISSING, false); +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(); \ No newline at end of file +$adminMenu = new ModuleAdmin(); Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/index.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/index.php 2015-04-28 21:55:41 UTC (rev 13050) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/index.php 2015-05-01 16:05:55 UTC (rev 13051) @@ -18,18 +18,18 @@ * @author Txmod Xoops http://www.txmodxoops.org * @version $Id: index.php 11084 2013-02-23 15:44:20Z timgno $ */ -include __DIR__ . DIRECTORY_SEPARATOR . 'header.php'; -$criteria = new CriteriaCompo(); +include __DIR__ . '/header.php'; +$criteria = new CriteriaCompo(); $count_modules = $tdmcreate->getHandler('modules')->getCount($criteria); -$count_tables = $tdmcreate->getHandler('tables')->getCount($criteria); -$count_fields = $tdmcreate->getHandler('fields')->getCount($criteria); +$count_tables = $tdmcreate->getHandler('tables')->getCount($criteria); +$count_fields = $tdmcreate->getHandler('fields')->getCount($criteria); unset($criteria); $template_main = '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'); -$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, '<label>' ._AM_TDMCREATE_THEREARE_NUMFIELDS. '</label>', $count_fields, 'Gray'); -//$xoopsOption['template_main'] = 'tdmcreate_index.html'; +$adminMenu->addInfoBox(_AM_TDMCREATE_ADMIN_NUMMODULES); +$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, '<label>' . _AM_TDMCREATE_THEREARE_NUMMODULES . '</label>', $count_modules, 'Green'); +$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, '<label>' . _AM_TDMCREATE_THEREARE_NUMTABLES . '</label>', $count_tables, 'Orange'); +$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, '<label>' . _AM_TDMCREATE_THEREARE_NUMFIELDS . '</label>', $count_fields, 'Gray'); +//$xoopsOption['template_main'] = 'tdmcreate_index.html'; $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('index.php')); $GLOBALS['xoopsTpl']->assign('index', $adminMenu->renderIndex()); -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/menu.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/menu.php 2015-04-28 21:55:41 UTC (rev 13050) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/menu.php 2015-05-01 16:05:55 UTC (rev 13051) @@ -18,33 +18,33 @@ * @author Txmod Xoops http://www.txmodxoops.org * @version $Id: menu.php 11084 2013-02-23 15:44:20Z timgno $ */ -$module_handler =& xoops_gethandler('module'); -$xoopsModule =& XoopsModule::getByDirname('TDMCreate'); -$moduleInfo =& $module_handler->get($xoopsModule->getVar('mid')); -$sysPathIcon32 = $moduleInfo->getInfo('sysicons32'); -$adminmenu = array(); -$i = 1; +$module_handler =& xoops_gethandler('module'); +$xoopsModule =& XoopsModule::getByDirname('TDMCreate'); +$moduleInfo =& $module_handler->get($xoopsModule->getVar('mid')); +$sysPathIcon32 = $moduleInfo->getInfo('sysicons32'); +$adminmenu = array(); +$i = 1; $adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU1; -$adminmenu[$i]['link'] = 'admin/index.php'; -$adminmenu[$i]['icon'] = $sysPathIcon32.'/dashboard.png'; +$adminmenu[$i]['link'] = 'admin/index.php'; +$adminmenu[$i]['icon'] = $sysPathIcon32 . '/dashboard.png'; $i++; $adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU2; -$adminmenu[$i]['link'] = 'admin/modules.php'; -$adminmenu[$i]['icon'] = 'assets/icons/32/addmodule.png'; +$adminmenu[$i]['link'] = 'admin/modules.php'; +$adminmenu[$i]['icon'] = 'assets/icons/32/addmodule.png'; $i++; $adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU3; -$adminmenu[$i]['link'] = 'admin/tables.php'; -$adminmenu[$i]['icon'] = 'assets/icons/32/addtable.png'; +$adminmenu[$i]['link'] = 'admin/tables.php'; +$adminmenu[$i]['icon'] = 'assets/icons/32/addtable.png'; $i++; $adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU4; -$adminmenu[$i]['link'] = 'admin/fields.php'; -$adminmenu[$i]['icon'] = 'assets/icons/32/fields.png'; +$adminmenu[$i]['link'] = 'admin/fields.php'; +$adminmenu[$i]['icon'] = 'assets/icons/32/fields.png'; $i++; $adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU5; -$adminmenu[$i]['link'] = 'admin/building.php'; -$adminmenu[$i]['icon'] = 'assets/icons/32/builder.png'; +$adminmenu[$i]['link'] = 'admin/building.php'; +$adminmenu[$i]['icon'] = 'assets/icons/32/builder.png'; $i++; $adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU6; -$adminmenu[$i]['link'] = 'admin/about.php'; -$adminmenu[$i]['icon'] = $sysPathIcon32.'/about.png'; -unset($i); \ No newline at end of file +$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-04-28 21:55:41 UTC (rev 13050) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/modules.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,237 +18,235 @@ * @author Txmod Xoops <su...@tx...> * @version $Id: 1.59 modules.php 11297 2013-03-24 10:58:10Z timgno $ */ -include __DIR__ . DIRECTORY_SEPARATOR . 'header.php'; -// Recovered value of argument op in the URL $ +include __DIR__ . '/header.php'; +// Recovered value of argument op in the URL $ $op = XoopsRequest::getString('op', 'list'); // $mod_id = XoopsRequest::getInt('mod_id'); // -switch ($op) -{ - case 'list': - default: - $start = XoopsRequest::getInt('start', 0); +switch ($op) { + case 'list': + default: + $start = XoopsRequest::getInt('start', 0); $limit = XoopsRequest::getInt('limit', $tdmcreate->getConfig('modules_adminpager')); - // Define main template - $template_main = 'tdmcreate_modules.tpl'; - $GLOBALS['xoTheme']->addScript('modules/tdmcreate/assets/js/functions.js'); - $GLOBALS['xoTheme']->addStylesheet( 'modules/tdmcreate/assets/css/admin/style.css' ); + // Define main template + $template_main = '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')); - $adminMenu->addItemButton(_AM_TDMCREATE_ADD_MODULE, 'modules.php?op=new', 'add'); - $GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton()); - $GLOBALS['xoopsTpl']->assign('tdmc_url', TDMC_URL); - $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); + $adminMenu->addItemButton(_AM_TDMCREATE_ADD_MODULE, 'modules.php?op=new', 'add'); + $GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton()); + $GLOBALS['xoopsTpl']->assign('tdmc_url', TDMC_URL); + $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); - // Redirect if there aren't modules - if ( $nb_modules == 0 ) { - 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 ( $nb_modules > $limit ) { - include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; - $pagenav = new XoopsPageNav($nb_modules, $limit, $start, 'start', 'op=list&limit=' . $limit); - $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4)); - } - } else { - $GLOBALS['xoopsTpl']->assign('error', _AM_TDMCREATE_THEREARENT_MODULES); - } - break; + $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); + // Redirect if there aren't modules + if (0 == $nb_modules) { + 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('... [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 ($fieldsObj->insert($fieldsObj, true)) { redirect_header('fields.php', 3, _AM_TDMCREATE_TOGGLE_SUCCESS); } else { redirect_header('fields.php', 3, _AM_TDMCREATE_TOGGLE_FAILED); } - break; + break; } -include __DIR__ . '/footer.php'; +include __DIR__ . '/footer.php'; \ No newline at end of file Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/tables.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/tables.php 2015-05-01 16:05:55 UTC (rev 13051) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/tables.php 2015-05-02 13:42:44 UTC (rev 13052) @@ -28,7 +28,6 @@ $tableMid = XoopsRequest::getInt('table_mid'); $tableName = XoopsRequest::getInt('table_name'); $tableNumbFields = XoopsRequest::getInt('table_nbfields'); -$tableOrder = XoopsRequest::getInt('table_order'); $tableFieldname = XoopsRequest::getString('table_fieldname', ''); // switch ($op) { @@ -39,6 +38,7 @@ // Define main template $template_main = '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'); $GLOBALS['xoTheme']->addScript('modules/tdmcreate/assets/js/sortable.js'); $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('tables.php')); @@ -147,10 +147,12 @@ redirect_header('tables.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors())); } // + $tables =& $tdmcreate->getHandler('tables'); + // if (isset($tableId)) { $tablesObj =& $tables->get($tableId); } else { - // Checking if table name exist + // 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); @@ -163,12 +165,13 @@ } $tablesObj =& $tables->create(); } + $tableOrder = XoopsRequest::getInt('table_order'); $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_category' => ((1 == $_REQUEST['table_category']) ? 1 : 0), 'table_nbfields' => $tableNumbFields, 'table_order' => $order, 'table_fieldname' => $tableFieldname)); @@ -189,24 +192,24 @@ $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'] + 'table_autoincrement' => ((1 == $_REQUEST['table_autoincrement']) ? 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), + 'table_submit' => ((1 == $_REQUEST['table_submit']) ? 1 : 0), + 'table_tag' => ((1 == $_REQUEST['table_tag']) ? 1 : 0), + 'table_broken' => ((1 == $_REQUEST['table_broken']) ? 1 : 0), + 'table_search' => ((1 == $_REQUEST['table_search']) ? 1 : 0), + 'table_comments' => ((1 == $_REQUEST['table_comments']) ? 1 : 0), + 'table_notifications' => ((1 == $_REQUEST['table_notifications']) ? 1 : 0), + 'table_permissions' => ((1 == $_REQUEST['table_permissions']) ? 1 : 0), + 'table_rate' => ((1 == $_REQUEST['table_rate']) ? 1 : 0), + 'table_print' => ((1 == $_REQUEST['table_print']) ? 1 : 0), + 'table_pdf' => ((1 == $_REQUEST['table_pdf']) ? 1 : 0), + 'table_rss' => ((1 == $_REQUEST['table_rss']) ? 1 : 0), + 'table_single' => ((1 == $_REQUEST['table_single']) ? 1 : 0), + 'table_visit' => ((1 == $_REQUEST['table_visit']) ? 1 : 0) )); // if ($tables->insert($tablesObj)) { @@ -215,11 +218,6 @@ $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 { - // 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'])); } } @@ -284,13 +282,13 @@ foreach ($_POST['mod_id'] as $key => $value) { if ($key > 0) { $modulesObj =& $tdmcreate->getHandler('modules')->get($value); - $modulesObj->setVar('mod_admin', ($_REQUEST['mod_admin'][$key] == 1) ? 0 : 1); - $modulesObj->setVar('mod_user', ($_REQUEST['mod_user'][$key] == 1) ? 0 : 1); - $modulesObj->setVar('mod_blocks', ($_REQUEST['mod_blocks'][$key] == 1) ? 0 : 1); - $modulesObj->setVar('mod_search', ($_REQUEST['mod_search'][$key] == 1) ? 0 : 1); - $modulesObj->setVar('mod_comments', ($_REQUEST['mod_comments'][$key] == 1) ? 0 : 1); - $modulesObj->setVar('mod_notifications', ($_REQUEST['mod_notifications'][$key] == 1) ? 0 : 1); - $modulesObj->setVar('mod_permissions', ($_REQUEST['mod_permissions'][$key] == 1) ? 0 : 1); + $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); } } if ($modules->insert($modulesObj, true)) { @@ -302,16 +300,17 @@ 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', ($_REQUEST['table_admin'][$key] == 1) ? 0 : 1); - $tablesObj->setVar('table_user', ($_REQUEST['table_user'][$key] == 1) ? 0 : 1); - $tablesObj->setVar('table_blocks', ($_REQUEST['table_blocks'][$key] == 1) ? 0 : 1); - $tablesObj->setVar('table_submenu', ($_REQUEST['table_submenu'][$key] == 1) ? 0 : 1); - $tablesObj->setVar('table_search', ($_REQUEST['table_search'][$key] == 1) ? 0 : 1); - $tablesObj->setVar('table_comments', ($_REQUEST['table_comments'][$key] == 1) ? 0 : 1); - $tablesObj->setVar('table_notifications', ($_REQUEST['table_notifications'][$key] == 1) ? 0 : 1); + $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_comments', (1 == $_REQUEST['table_comments'][$key]) ? 0 : 1); + $tablesObj->setVar('table_notifications', (1 == $_REQUEST['table_notifications'][$key]) ? 0 : 1); } } if ($tables->insert($tablesObj, true)) { 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-01 16:05:55 UTC (rev 13051) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/css/admin/style.css 2015-05-02 13:42:44 UTC (rev 13052) @@ -26,12 +26,16 @@ text-shadow: 1px 1px 1px #fff; } -table { margin: 0; padding: 0; } +table { margin: 0; padding: 0; width: 100%; } /* Sortable tables & fields */ +tbody tr td.sortable { + text-align: center; + width: 100%; +} + tbody tr td.sortable img.move { cursor: move; - text-align: center; } tbody tr:hover { @@ -138,7 +142,7 @@ background-color: #efefef; } -.table-list tr { margin: 0; padding: 0; } +.table-list tr { margin: 0; padding: 0; width: 100%; } .table-list tr td img.move { margin-right: 20px; @@ -209,16 +213,16 @@ width: 5%; } -.field-list tr { margin: 0; padding: 0; } +.field-list tr { margin: 0; padding: 0; width: 100%; } .field-list tr td { padding: 5px 2px; margin-bottom: 3px; - background-color: #efefef; + /* 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 */ + filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, StartColorStr=#efefef, EndColorStr=#e1e1e1); vale solo per IE */ text-shadow:1px 1px 0 #fff; color:#ff8400; } @@ -230,4 +234,4 @@ } .field-list tr td strong { vertical-align: middle; -} +} \ No newline at end of file Added: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/SplClassLoader.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/SplClassLoader.php (rev 0) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/SplClassLoader.php 2015-05-02 13:42:44 UTC (rev 13052) @@ -0,0 +1,155 @@ +<?php + +/* + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * This software consists of voluntary contributions made by many individuals + * and is licensed under the MIT license. For more information, see + * <http://www.doctrine-project.org>. + */ + +/** + * SplClassLoader implementation that implements the technical interoperability + * standards for PHP 5.3 namespaces and class names. + * + * http://groups.google.com/group/php-standards/web/psr-0-final-proposal?pli=1 + * + * // Example which loads classes for the Doctrine Common package in the + * // Doctrine\Common namespace. + * $classLoader = new SplClassLoader('Doctrine\Common', '/path/to/doctrine'); + * $classLoader->register(); + * + * @license http://www.opensource.org/licenses/mit-license.html MIT License + * @author Jonathan H. Wage <jo...@gm...> + * @author Roman S. Borschel <ro...@co...> + * @author Matthew Weier O'Phinney <ma...@ze...> + * @author Kris Wallsmith <kri...@gm...> + * @author Fabien Potencier <fab...@sy...> + */ +class SplClassLoader +{ + private $_fileExtension = '.php'; + private $_namespace; + private $_includePath; + private $_namespaceSeparator = '\\'; + + /** + * Creates a new <tt>SplClassLoader</tt> that loads classes of the + * specified namespace. + * + * @param string $ns The namespace to use. + */ + public function __construct($ns = null, $includePath = null) + { + $this->_namespace = $ns; + $this->_includePath = $includePath; + } + + /** + * Sets the namespace separator used by classes in the namespace of this class loader. + * + * @param string $sep The separator to use. + */ + public function setNamespaceSeparator($sep) + { + $this->_namespaceSeparator = $sep; + } + + /** + * Gets the namespace seperator used by classes in the namespace of this class loader. + * + * @return void + */ + public function getNamespaceSeparator() + { + return $this->_namespaceSeparator; + } + + /** + * Sets the base include path for all class files in the namespace of this class loader. + * + * @param string $includePath + */ + public function setIncludePath($includePath) + { + $this->_includePath = $includePath; + } + + /** + * Gets the base include path for all class files in the namespace of this class loader. + * + * @return string $includePath + */ + public function getIncludePath() + { + return $this->_includePath; + } + + /** + * Sets the file extension of class files in the namespace of this class loader. + * + * @param string $fileExtension + */ + public function setFileExtension($fileExtension) + { + $this->_fileExtension = $fileExtension; + } + + /** + * Gets the file extension of class files in the namespace of this class loader. + * + * @return string $fileExtension + */ + public function getFileExtension() + { + return $this->_fileExtension; + } + + /** + * Installs this class loader on the SPL autoload stack. + */ + public function register() + { + spl_autoload_register(array($this, 'loadClass')); + } + + /** + * Uninstalls this class loader from the SPL autoloader stack. + */ + public function unregister() + { + spl_autoload_unregister(array($this, 'loadClass')); + } + + /** + * Loads the given class or interface. + * + * @param string $className The name of the class to load. + * @return void + */ + public function loadClass($className) + { + if (null === $this->_namespace || $this->_namespace.$this->_namespaceSeparator === substr($className, 0, strlen($this->_namespace.$this->_namespaceSeparator))) { + $fileName = ''; + $namespace = ''; + if (false !== ($lastNsPos = strripos($className, $this->_namespaceSeparator))) { + $namespace = substr($className, 0, $lastNsPos); + $className = substr($className, $lastNsPos + 1); + $fileName = str_replace($this->_namespaceSeparator, DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR; + } + $fileName .= str_replace('_', DIRECTORY_SEPARATOR, $className) . $this->_fileExtension; + + require ($this->_includePath !== null ? $this->_includePath . DIRECTORY_SEPARATOR : '') . $fileName; + } + } +} \ 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-01 16:05:55 UTC (rev 13051) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/fields.php 2015-05-02 13:42:44 UTC (rev 13052) @@ -85,10 +85,8 @@ } /* - * @static function &getInstance - * @param null - */ - /** + * @static function &getInstance + * * @return TDMCreateFields */ public static function &getInstance() @@ -102,10 +100,8 @@ } /* - * @private function getHeaderForm - * @param mixed $action - */ - /** + * @private function getHeaderForm + * * @param bool $action * @return TDMCreateThemeForm */ @@ -143,15 +139,8 @@ } /* - * @public function getFormNew - * - * @param integer $field_mid - * @param integer $field_tid - * @param integer $field_numb - * @param string $field_name - * @param mixed $action - */ - /** + * @public function getFormNew + * * @param null $field_mid * @param null $field_tid * @param null $field_numb @@ -179,20 +168,9 @@ return $fieldsForm->getFooterForm($form); } - /* - * @private function getFormNewLine - * - * @param mixed $form - * @param mixed $class - * @param integer $i - * @param integer $field_mid - * @param integer $field_tid - * @param mixed $f_name - * @param integer $table_autoincrement - * - * @author timgno - modified in getFormNewLine by goffy - */ /** + * @private function getFormNewLine + * * @param $form * @param $class * @param $i @@ -311,30 +289,24 @@ } /* - * @public function getFormEdit - * - * @param integer $field_mid - * @param integer $field_tid - * @param mixed $action - */ - /** + * @public function getFormEdit + * * @param null $field_mid * @param null $field_tid - * @param null $field_numb * @param bool $action * @return mixed */ public function getFormEdit($field_mid = null, $field_tid = null, $action = false) { // Header function class - $fields_form = TDMCreateFields::getInstance(); - $form = $fields_form->getHeaderForm($action); + $fieldsForm = TDMCreateFields::getInstance(); + $form = $fieldsForm->getHeaderForm($action); // $class = 'even'; // Get the number of fields - goffy $tablesHandler =& $this->tdmcreate->getHandler('tables'); $table_autoincrement = $tablesHandler->get($field_tid)->getVar('table_autoincrement'); - $field_numb = $tablesHandler->get($field_tid)->getVar('table_nbfields'); + $field_numb = $tablesHandler->get($field_tid)->getVar('table_nbfields'); $f_name = $tablesHandler->get($field_tid)->getVar('table_fieldname'); // Get the list of fields @@ -353,10 +325,10 @@ $this->tdmcreate->getHandler('fields')->delete($fieldsObj, true); } else { // show field with settings - $form->addElement(new XoopsFormHidden('field_id[' . $field_id . ']', $field_id)); - $form->addElement(new XoopsFormHidden('field_mid', $field_mid)); - $form->addElement(new XoopsFormHidden('field_tid', $field_tid)); - + $form->addElement(new XoopsFormHidden('field_id[' . $id . ']', $field_id)); + //$form->addElement(new XoopsFormHidden('field_mid', $field_mid)); + //$form->addElement(new XoopsFormHidden('field_tid', $field_tid)); + $form->addElement(new TDMCreateFormLabel('<tr class="' . $class . '">')); // Index ID $form->addElement(new TDMCreateFormLabel('<td class="center">' . $id . '</td>')); @@ -457,7 +429,7 @@ unset($id); // Footer form - return $fields_form->getFooterForm($form); + return $fieldsForm->getFooterForm($form); } /* Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminObjects.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminObjects.php 2015-05-01 16:05:55 UTC (rev 13051) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminObjects.php 2015-05-02 13:42:44 UTC (rev 13052) @@ -38,7 +38,6 @@ if (!$instance) { $instance = new self(); } - return $instance; } @@ -46,19 +45,14 @@ * @public function getSimpleSetVar * @param string $tableName * @param string $fieldName + * @return string */ - /** - * @param $tableName - * @param $fieldName - * @return string - */ public function getSimpleSetVar($tableName, $fieldName) { $ret = <<<EOT // Set Var {$fieldName} \${$tableName}Obj->setVar('{$fieldName}', \$_POST['{$fieldName}']);\n EOT; - return $ret; } @@ -66,19 +60,14 @@ * @public function getTextDateSelectSetVar * @param string $tableName * @param string $fieldName + * @return string */ - /** - * @param $tableName - * @param $fieldName - * @return string - */ public function getTextDateSelectSetVar($tableName, $fieldName) { $ret = <<<EOT // Set Var {$fieldName} \${$tableName}Obj->setVar('{$fieldName}', strtotime(\$_POST['{$fieldName}']));\n EOT; - return $ret; } @@ -86,19 +75,14 @@ * @public function getCheckBoxOrRadioYNSetVar * @param string $tableName * @param string $fieldName + * @return string */ - /** - * @param $tableName - * @param $fieldName - * @return string - */ public function getCheckBoxOrRadioYNSetVar($tableName, $fieldName) { $ret = <<<EOT // Set Var {$fieldName} \${$tableName}Obj->setVar('{$fieldName}', ((1 == \$_REQUEST['{$fieldName}']) ? '1' : '0'));\n EOT; - return $ret; } @@ -106,19 +90,14 @@ * @public function getUrlFileSetVar * @param string $tableName * @param string $fieldName + * @return string */ - /** - * @param $tableName - * @param $fieldName - * @return string - */ public function getUrlFileSetVar($tableName, $fieldName) { $ret = <<<EOT // Set Var {$fieldName} - \${$tableName}Obj->setVar('{$fieldName}', formtUrl(\$_REQUEST['{$fieldName}']));\n + \${$tableName}Obj->setVar('{$fieldName}', formatUrl(\$_REQUEST['{$fieldName}']));\n EOT; - return $ret; } @@ -127,13 +106,8 @@ * @param string $moduleDirname * @param string $tableName * @param string $fieldName + * @return string */ - /** - * @param $moduleDirname - * @param $tableName - * @param $fieldName - * @return string - */ public function getImageListSetVar($moduleDirname, $tableName, $fieldName) { $ret = <<<EOT @@ -155,7 +129,6 @@ \${$tableName}Obj->setVar('{$fieldName}', \$_POST['{$fieldName}']); }\n EOT; - return $ret; } @@ -164,13 +137,8 @@ * @param string $moduleDirname * @param string $tableName * @param string $fieldName + * @return string */ - /** - * @param $moduleDirname - * @param $tableName - * @param $fieldName - * @return string - */ public function getUploadImageSetVar($moduleDirname, $tableName, $fieldName) { $stuModuleDirname = strtoupper($moduleDirname); @@ -193,7 +161,6 @@ \${$tableName}Obj->setVar('{$fieldName}', \$_POST['{$fieldName}']); }\n EOT; - return $ret; } @@ -202,13 +169,8 @@ * @param string $moduleDirname * @param string $tableName * @param string $fieldName + * @return string */ - /** - * @param $moduleDirname - * @param $tableName - * @param $fieldName - * @return string - */ public function getUploadFileSetVar($moduleDirname, $tableName, $fieldName) { $stuModuleDirname = strtoupper($moduleDirname); @@ -229,7 +191,6 @@ } }\n EOT; - return $ret; } @@ -239,21 +200,14 @@ * @param string $rpFieldName * @param string $tableName * @param string $fieldName + * @return string */ - /** - * @param $lpFieldName - * @param $rpFieldName - * @param $tableName - * @param $fieldName - * @return string - */ public function getSimpleGetVar($lpFieldName, $rpFieldName, $tableName, $fieldName) { $ret = <<<EOT \t\t\t\t// Get Var {$fieldName} \t\t\t\t\${$lpFieldName}['{$rpFieldName}'] = \${$tableName}All[\$i]->getVar('{$fieldName}');\n EOT; - return $ret; } @@ -265,16 +219,8 @@ * @param string $tableNameTopic * @param string $fieldNameParent * @param string $fieldNameTopic + * @return string */ - /** - * @param $lpFieldName - * @param $rpFieldName - * @param $tableName - * @param $tableNameTopic - * @param $fieldNameParent - * @param $fieldNameTopic - * @return string - */ public function getTopicGetVar($lpFieldName, $rpFieldName, $tableName, $tableNameTopic, $fieldNameParent, $fieldNameTopic) { $ret = <<<EOT @@ -282,7 +228,6 @@ \t\t\t\t\${$rpFieldName} =& \${$tableNameTopic}Handler->get(\${$tableName}All[\$i]->getVar('{$fieldNameParent}')); \t\t\t\t\${$lpFieldName}['{$rpFieldName}'] = \${$rpFieldName}->getVar('{$fieldNameTopic}');\n EOT; - return $ret; } @@ -292,14 +237,8 @@ * @param string $rpFieldName * @param string $tableName * @param string $fieldName + * @return string */ - /** - * @param $lpFieldName - * @param $rpFieldName - * @param $tableName - * @param $fieldName - * @return string - */ public function getUploadImageGetVar($lpFieldName, $rpFieldName, $tableName, $fieldName) { $ret = <<<EOT @@ -308,7 +247,6 @@ \t\t\t\t\$upload_image = \${$fieldName} ? \${$fieldName} : 'blank.gif'; \t\t\t\t\${$lpFieldName}['{$rpFieldName}'] = \$upload_image;\n EOT; - return $ret; } /* @@ -319,22 +257,13 @@ * @param string $fieldName * @return string */ - /* - * @public function getUrlFileGetVar - * @param $lpFieldName - * @param $rpFieldName - * @param $tableName - * @param $fieldName - * @return string - */ public function getUrlFileGetVar($lpFieldName, $rpFieldName, $tableName, $fieldName) { $ret = <<<EOT \t\t\t\t// Get Var {$fieldName} \t\t\t\t\${$lpFieldName}['{$rpFieldName}'] = \${$tableName}All[\$i]->getVar('{$fieldName}');\n EOT; - - return $ret; + return $ret; } /* * @public function getTextAreaGetVar @@ -342,21 +271,14 @@ * @param string $rpFieldName * @param string $tableName * @param string $fieldName + * @return string */ - /** - * @param $lpFieldName - * @param $rpFieldName - * @param $tableName - * @param $fieldName - * @return string - */ public function getTextAreaGetVar($lpFieldName, $rpFieldName, $tableName, $fieldName) { $ret = <<<EOT \t\t\t\t// Get Var {$fieldName} \t\t\t\t\${$lpFieldName}['{$rpFieldName}'] = strip_tags(\${$tableName}All[\$i]->getVar('{$fieldName}'));\n EOT; - return $ret; } @@ -366... [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 $moduleDirname */ /** * @param $moduleDirname @@ -353,7 +353,7 @@ /* * @private function getXoopsVersionSubmenu - * @param string $language + * @param $language */ /** * @param $language @@ -384,8 +384,8 @@ /* * @private function getXoopsVersionBlocks - * @param string $moduleDirname - * @param string $language + * @param $moduleDirname + * @param $language */ /** * @param $moduleDirname @@ -420,8 +420,8 @@ /* * @private function getXoopsVersionConfig - * @param string $moduleDirname - * @param string $language + * @param $moduleDirname + * @param $language */ /** * @param $module @@ -596,15 +596,15 @@ /* * @private function getTypeNotifications - * @param string $language - * @param string $type - * @param string $tableName - * @param string $item - * @param string $typeOfNotify + * @param $language + * @param $type + * @param $tableName + * @param $item + * @param $typeOfNotify */ /** * @param $language - * @param string $type + * @param $type * @param $tableName * @param $notifyFile * @param $item @@ -647,8 +647,8 @@ /* * @private function getXoopsVersionNotifications - * @param string $moduleDirname - * @param string $language + * @param $moduleDirname + * @param $language */ /** * @param $moduleDirname Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/tables.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/tables.php 2015-05-03 07:22:23 UTC (rev 13053) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/tables.php 2015-05-03 12:51:24 UTC (rev 13054) @@ -51,6 +51,7 @@ $this->initVar('table_mid', XOBJ_DTYPE_INT); $this->initVar('table_category', XOBJ_DTYPE_INT); $this->initVar('table_name', XOBJ_DTYPE_TXTBOX); + $this->initVar('table_solename', XOBJ_DTYPE_TXTBOX); $this->initVar('table_fieldname', XOBJ_DTYPE_TXTBOX); $this->initVar('table_nbfields', XOBJ_DTYPE_INT); $this->initVar('table_order', XOBJ_DTYPE_INT); @@ -137,9 +138,13 @@ } $form->addElement($mods_select, true); // - $table_name_field = new XoopsFormText(_AM_TDMCREATE_TABLE_NAME, 'table_name', 50, 255, $table_name); + $table_name_field = new XoopsFormText(_AM_TDMCREATE_TABLE_NAME, 'table_name', 40, 150, $table_name); $table_name_field->setDescription(_AM_TDMCREATE_TABLE_NAME_DESC); $form->addElement($table_name_field, true); + // + $table_solename_field = new XoopsFormText(_AM_TDMCREATE_TABLE_SOLENAME, 'table_solename', 40, 150, $this->getVar('table_solename')); + $table_solename_field->setDescription(_AM_TDMCREATE_TABLE_SOLENAME_DESC); + $form->addElement($table_solename_field, true); // $tablesHandler =& $this->tdmcreate->getHandler('tables'); $criteria = new CriteriaCompo(new Criteria('table_category', 0), 'AND'); Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/language/english/admin.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/language/english/admin.php 2015-05-03 07:22:23 UTC (rev 13053) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/language/english/admin.php 2015-05-03 12:51:24 UTC (rev 13054) @@ -137,6 +137,10 @@ define('_AM_TDMCREATE_TABLE_MODULES', "Choose a module"); define('_AM_TDMCREATE_TABLE_NAME', "Table Name"); define('_AM_TDMCREATE_TABLE_NAME_DESC', "Unique Name: It's recommended to use plural word (i.e.: <span style='text-decoration: underline;'>categorie</span><span class='white bold'>s</span>)"); +// Added in version 1.91 +define('_AM_TDMCREATE_TABLE_SOLENAME', "Table Singular Name"); +define('_AM_TDMCREATE_TABLE_SOLENAME_DESC', "Singular Name: It's recommended to use singular word (i.e.: <span style='text-decoration: underline;'>category</span> for admin buttons)"); + define('_AM_TDMCREATE_TABLE_CATEGORY', "This table is a category or topic?"); define('_AM_TDMCREATE_TABLE_CATEGORY_DESC', "<b class='red bold'>WARNING</b>: <i>Once you have used this option for this module, and edit this table,<br />will not be displayed following the creation of other tables</i>"); define('_AM_TDMCREATE_TABLE_NBFIELDS', "Number fields"); Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/sql/mysql.sql =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/sql/mysql.sql 2015-05-03 07:22:23 UTC (rev 13053) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/sql/mysql.sql 2015-05-03 12:51:24 UTC (rev 13054) @@ -62,6 +62,7 @@ `table_mid` INT(5) UNSIGNED NOT NULL DEFAULT '0', `table_category` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', `table_name` VARCHAR(150) NOT NULL DEFAULT '', + `table_solename` VARCHAR(150) NOT NULL DEFAULT '', `table_fieldname` VARCHAR(150) NOT NULL DEFAULT '', `table_nbfields` INT(5) UNSIGNED NOT NULL DEFAULT '0', `table_order` INT(5) UNSIGNED NOT NULL DEFAULT '0', |
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/AdminObjects.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminObjects.php 2015-05-16 05:58:18 UTC (rev 13063) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminObjects.php 2015-05-19 18:10:46 UTC (rev 13064) @@ -156,7 +156,7 @@ * @param string $fieldName * @return string */ - public function getUploadImageSetVar($moduleDirname, $tableName, $fieldName) + public function getUploadImageSetVar($moduleDirname, $tableName, $fieldName, $fpmf) { $stuModuleDirname = strtoupper($moduleDirname); $ret = <<<EOT @@ -165,9 +165,11 @@ \$uploaddir = {$stuModuleDirname}_UPLOAD_PATH.'/images/{$tableName}'; \$uploader = new XoopsMediaUploader(\$uploaddir, \${$moduleDirname}->getConfig('mimetypes'), \${$moduleDirname}->getConfig('maxsize'), null, null); - if (\$uploader->fetchMedia(\$_POST['xoops_upload_file'][])) { - //\$uploader->setPrefix('{$fieldName}_'); - //\$uploader->fetchMedia(\$_POST['xoops_upload_file'][]); + if (\$uploader->fetchMedia(\$_POST['xoops_upload_file'][0])) { + \$extension = preg_replace( '/^.+\.([^.]+)$/sU' , '' , \$_FILES['attachedfile']['name']); + \$imgName = str_replace(' ', '', \$_POST['{$fpmf}']).'.'.\$extension; + \$uploader->setPrefix(\$imgName); + \$uploader->fetchMedia(\$_POST['xoops_upload_file'][0]); if (!\$uploader->upload()) { \$errors = \$uploader->getErrors(); redirect_header('javascript:history.go(-1)', 3, \$errors); 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-16 05:58:18 UTC (rev 13063) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminPages.php 2015-05-19 18:10:46 UTC (rev 13064) @@ -77,10 +77,10 @@ * @public function getAdminPagesHeader * @param string $moduleDirname * @param string $tableName - * @param $fpif + * @param $fieldId * @return string */ - public function getAdminPagesHeader($moduleDirname, $tableName, $fpif) + public function getAdminPagesHeader($moduleDirname, $tableName, $fieldId) { $ucfModuleDirname = ucfirst($moduleDirname); $ucfTableName = ucfirst($tableName); @@ -88,8 +88,8 @@ include __DIR__ . '/header.php'; //It recovered the value of argument op in URL$ \$op = XoopsRequest::getString('op', 'list'); -// Request {$fpif} -\${$fpif} = XoopsRequest::getInt('{$fpif}'); +// Request {$fieldId} +\${$fieldId} = XoopsRequest::getInt('{$fieldId}'); // Switch options switch (\$op) {\n @@ -105,12 +105,12 @@ * @param $tableFieldname * @param $language * @param $fields - * @param $fpif + * @param $fieldId * @param $fieldInForm - * @param $fpmf + * @param $fieldMain * @return string */ - public function getAdminPagesList($moduleDirname, $table, $language, $fields, $fpif, $fieldInForm, $fpmf) + public function getAdminPagesList($moduleDirname, $table, $language, $fields, $fieldId, $fieldInForm, $fieldMain) { $stuModuleDirname = strtoupper($moduleDirname); $tableName = $table->getVar('table_name'); @@ -125,7 +125,7 @@ default: \$start = XoopsRequest::getInt('start', 0); \$limit = XoopsRequest::getInt('limit', \${$moduleDirname}->getConfig('adminpager')); - \$template_main = '{$moduleDirname}_admin_{$tableName}.tpl'; + \$templateMain = '{$moduleDirname}_admin_{$tableName}.tpl'; \$GLOBALS['xoopsTpl']->assign('navigation', \$adminMenu->addNavigation('{$tableName}.php'));\n EOT; if (1 == $fieldInForm) { @@ -138,11 +138,12 @@ \$criteria = new CriteriaCompo(); \$criteria->setStart(\$start); \$criteria->setLimit(\$limit); - \$criteria->setSort('{$fpif} ASC, {$fpmf}'); + \$criteria->setSort('{$fieldId} ASC, {$fieldMain}'); \$criteria->setOrder('ASC'); \${$tableName}Count = \${$tableName}Handler->getCount(\$criteria); \${$tableName}All = \${$tableName}Handler->getAll(\$criteria); unset(\$criteria); + \$GLOBALS['xoopsTpl']->assign('{$moduleDirname}_count', \${$tableName}Count); \$GLOBALS['xoopsTpl']->assign('{$moduleDirname}_url', {$stuModuleDirname}_URL); \$GLOBALS['xoopsTpl']->assign('{$moduleDirname}_upload_url', {$stuModuleDirname}_UPLOAD_URL); // Table view @@ -267,26 +268,26 @@ * @param string $tableName * @param string $language * @param string $fields - * @param string $fpif - * @param string $fpmf + * @param string $fieldId + * @param string $fieldMain * @return string */ - public function getAdminPagesSave($moduleDirname, $tableName, $language, $fields, $fpif, $fpmf) + public function getAdminPagesSave($moduleDirname, $tableName, $language, $fields, $fieldId, $fieldMain) { $ret = <<<EOT case 'save': if ( !\$GLOBALS['xoopsSecurity']->check() ) { redirect_header('{$tableName}.php', 3, implode(',', \$GLOBALS['xoopsSecurity']->getErrors())); } - if (isset(\${$fpif})) { - \${$tableName}Obj =& \${$tableName}Handler->get(\${$fpif}); + if (isset(\${$fieldId})) { + \${$tableName}Obj =& \${$tableName}Handler->get(\${$fieldId}); } else { \${$tableName}Obj =& \${$tableName}Handler->create(); } // Set Vars\n EOT; foreach (array_keys($fields) as $f) { - $fieldName = $fields[$f]->getVar('field_name'); + $fieldName = $fields[$f]->getVar('field_name'); $fieldElement = $fields[$f]->getVar('field_element'); if ($f > 0) { // If we want to hide field id switch ($fieldElement) { @@ -301,7 +302,10 @@ $ret .= $this->adminobjects->getUrlFileSetVar($moduleDirname, $tableName, $fieldName); break; case 13: - $ret .= $this->adminobjects->getUploadImageSetVar($moduleDirname, $tableName, $fieldName); + 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); @@ -336,10 +340,10 @@ * @param string $tableName * @param string $tableFieldname * @param string $language - * @param string $fpif + * @param string $fieldId * @return string */ - public function getAdminPagesEdit($moduleDirname, $table, $language, $fpif) + public function getAdminPagesEdit($moduleDirname, $table, $language, $fieldId) { $tableName = $table->getVar('table_name'); $tableSoleName = $table->getVar('table_solename'); @@ -355,7 +359,7 @@ \$GLOBALS['xoopsTpl']->assign('navigation', \$adminMenu->addNavigation('{$tableName}.php')); \$GLOBALS['xoopsTpl']->assign('buttons', \$adminMenu->renderButton()); // Get Form - \${$tableName}Obj = \${$tableName}Handler->get(\${$fpif}); + \${$tableName}Obj = \${$tableName}Handler->get(\${$fieldId}); \$form = \${$tableName}Obj->getForm(); \$GLOBALS['xoopsTpl']->assign('form', \$form->render()); break;\n @@ -368,15 +372,15 @@ * @public function getAdminPagesDelete * @param string $tableName * @param string $language - * @param string $fpif - * @param string $fpmf + * @param string $fieldId + * @param string $fieldMain * @return string */ - public function getAdminPagesDelete($tableName, $language, $fpif, $fpmf) + public function getAdminPagesDelete($tableName, $language, $fieldId, $fieldMain) { $ret = <<<EOT case 'delete': - \${$tableName}Obj =& \${$tableName}Handler->get(\${$fpif}); + \${$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())); @@ -387,7 +391,7 @@ echo \${$tableName}Obj->getHtmlErrors(); } } else { - xoops_confirm(array('ok' => 1, '{$fpif}' => \${$fpif}, 'op' => 'delete'), \$_SERVER['REQUEST_URI'], sprintf({$language}FORMSUREDEL, \${$tableName}Obj->getVar('{$fpmf}'))); + xoops_confirm(array('ok' => 1, '{$fieldId}' => \${$fieldId}, 'op' => 'delete'), \$_SERVER['REQUEST_URI'], sprintf({$language}FORMSUREDEL, \${$tableName}Obj->getVar('{$fieldMain}'))); } break;\n EOT; @@ -400,17 +404,17 @@ * @param string $moduleDirname * @param string $tableName * @param string $language - * @param string $fpif - * @param string $fpmf + * @param string $fieldId + * @param string $fieldMain * @return string */ - public function getAdminPagesUpdate($moduleDirname, $tableName, $language, $fpif, $fpmf) + public function getAdminPagesUpdate($moduleDirname, $tableName, $language, $fieldId, $fieldMain) { $upModuleName = strtoupper($moduleDirname); $ret = <<<EOT case 'update': - if (isset(\${$fpif})) { - \${$tableName}Obj =& \${$tableName}Handler->get(\${$fpif}); + if (isset(\${$fieldId})) { + \${$tableName}Obj =& \${$tableName}Handler->get(\${$fieldId}); } \${$tableName}Obj->setVar("\${$tableName}_display", \$_POST["\${$tableName}_display"]); @@ -461,21 +465,21 @@ $fieldName = $fields[$f]->getVar('field_name'); $fieldInForm = $fields[$f]->getVar('field_inform'); if (0 == $f) { - $fpif = $fieldName; + $fieldId = $fieldName; } if (1 == $fields[$f]->getVar('field_main')) { - $fpmf = $fieldName; + $fieldMain = $fieldName; } } $content = $this->getHeaderFilesComments($module, $filename); - $content .= $this->getAdminPagesHeader($moduleDirname, $tableName, $fpif); - $content .= $this->getAdminPagesList($moduleDirname, $table, $language, $fields, $fpif, $fieldInForm, $fpmf); + $content .= $this->getAdminPagesHeader($moduleDirname, $tableName, $fieldId); + $content .= $this->getAdminPagesList($moduleDirname, $table, $language, $fields, $fieldId, $fieldInForm, $fieldMain); if (1 == $fieldInForm) { $content .= $this->getAdminPagesNew($moduleDirname, $tableName, $language); - $content .= $this->getAdminPagesSave($moduleDirname, $tableName, $language, $fields, $fpif, $fpmf); - $content .= $this->getAdminPagesEdit($moduleDirname, $table, $language, $fpif); + $content .= $this->getAdminPagesSave($moduleDirname, $tableName, $language, $fields, $fieldId, $fieldMain); + $content .= $this->getAdminPagesEdit($moduleDirname, $table, $language, $fieldId); } - $content .= $this->getAdminPagesDelete($tableName, $language, $fpif, $fpmf); + $content .= $this->getAdminPagesDelete($tableName, $language, $fieldId, $fieldMain); $content .= $this->getAdminPagesFooter(); // $this->tdmcfile->create($moduleDirname, 'admin', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED); 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-16 05:58:18 UTC (rev 13063) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminPermissions.php 2015-05-19 18:10:46 UTC (rev 13064) @@ -99,7 +99,7 @@ if (count ( array_intersect ( \$group, \$groups ) ) <= 0) { redirect_header ( 'index.php', 3, _NOPERM ); }*/ -\$template_main = '{$moduleDirname}_admin_permissions.tpl'; +\$templateMain = '{$moduleDirname}_admin_permissions.tpl'; echo \$adminMenu->addNavigation('permissions.php'); \$permission = {$moduleDirname}_CleanVars(\$_REQUEST, 'permission', 1, 'int'); Added: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/cache/classpaths.cache =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/cache/classpaths.cache (rev 0) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/cache/classpaths.cache 2015-05-19 18:10:46 UTC (rev 13064) @@ -0,0 +1 @@ +a:50:{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: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:22:"UserNotificationUpdate";s:110:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserNotificationUpdate.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:14:"LanguageBlocks";s:106:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\language\LanguageBlocks.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:9:"UserPrint";s:97:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserPrint.php";s:13:"TDMCreateFile";s:96:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\TDMCreateFile.php";s:20:"TDMCreateTableFields";s:103:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\TDMCreateTableFields.php";s:7:"UserRss";s:95:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserRss.php";} \ No newline at end of file Added: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/cache/index.html =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/cache/index.html (rev 0) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/cache/index.html 2015-05-19 18:10:46 UTC (rev 13064) @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file 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-16 05:58:18 UTC (rev 13063) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/classes/ClassFiles.php 2015-05-19 18:10:46 UTC (rev 13064) @@ -286,14 +286,14 @@ /* * @private function getPermissionsInForm * @param string $moduleDirname - * @param string $fpif + * @param string $fieldId */ /** * @param $moduleDirname - * @param $fpif + * @param $fieldId * @return string */ - private function getPermissionsInForm($moduleDirname, $fpif) + private function getPermissionsInForm($moduleDirname, $fieldId) { $permissionApprove = $this->getLanguage($moduleDirname, 'AM', 'PERMISSIONS_APPROVE'); $permissionSubmit = $this->getLanguage($moduleDirname, 'AM', 'PERMISSIONS_SUBMIT'); @@ -306,9 +306,9 @@ \$full_list = array_keys ( \$group_list ); global \$xoopsModule; if ( !\$this->isNew() ) { - \$groups_ids_approve = \$gperm_handler->getGroupIds ( '{$moduleDirname}_approve', \$this->getVar ( '{$fpif}' ), \$xoopsModule->getVar ( 'mid' ) ); - \$groups_ids_submit = \$gperm_handler->getGroupIds ( '{$moduleDirname}_submit', \$this->getVar ( '{$fpif}' ), \$xoopsModule->getVar ( 'mid' ) ); - \$groups_ids_view = \$gperm_handler->getGroupIds ( '{$moduleDirname}_view', \$this->getVar ( '{$fpif}' ), \$xoopsModule->getVar ( 'mid' ) ); + \$groups_ids_approve = \$gperm_handler->getGroupIds ( '{$moduleDirname}_approve', \$this->getVar ( '{$fieldId}' ), \$xoopsModule->getVar ( 'mid' ) ); + \$groups_ids_submit = \$gperm_handler->getGroupIds ( '{$moduleDirname}_submit', \$this->getVar ( '{$fieldId}' ), \$xoopsModule->getVar ( 'mid' ) ); + \$groups_ids_view = \$gperm_handler->getGroupIds ( '{$moduleDirname}_view', \$this->getVar ( '{$fieldId}' ), \$xoopsModule->getVar ( 'mid' ) ); \$groups_ids_approve = array_values ( \$groups_ids_approve ); \$groups_can_approve_checkbox = new XoopsFormCheckBox ( {$permissionApprove}, 'groups_approve[]', \$groups_ids_approve ); \$groups_ids_submit = array_values ( \$groups_ids_submit ); @@ -388,19 +388,19 @@ * @public function getClassHandler * @param string $moduleDirname * @param string $tableName - * @param string $fpif - * @param string $fpmf + * @param string $fieldId + * @param string $fieldMain */ /** * @param $moduleDirname * @param $tableName * @param $tableCategory * @param $tableFieldname - * @param $fpif - * @param $fpmf + * @param $fieldId + * @param $fieldMain * @return string */ - private function getClassHandler($moduleDirname, $table, $fpif, $fpmf) + private function getClassHandler($moduleDirname, $table, $fieldId, $fieldMain) { $tableName = $table->getVar('table_name'); $tableCategory = $table->getVar('table_category'); @@ -408,7 +408,7 @@ $tableFieldname = $table->getVar('table_fieldname'); $ucfModuleDirname = ucfirst($moduleDirname); $ucfTableName = ucfirst($tableName); - $ucfTableSoleName = ucfirst($tableSoleName); + $ucfTableSoleName = ucfirst($tableSoleName); $ucfModuleTable = $ucfModuleDirname . $ucfTableName; $ret = <<<EOT /* @@ -427,7 +427,7 @@ */ public function __construct(&\$db) { - parent::__construct(\$db, '{$moduleDirname}_{$tableName}', '{$moduleDirname}{$tableName}', '{$fpif}', '{$fpmf}'); + parent::__construct(\$db, '{$moduleDirname}_{$tableName}', '{$moduleDirname}{$tableName}', '{$fieldId}', '{$fieldMain}'); \$this->{$moduleDirname} = {$ucfModuleDirname}Helper::getInstance(); } @@ -505,7 +505,7 @@ \${$tableName}Handler = \$this->{$moduleDirname}->getHandler( '{$tableName}' ); \${$tableSoleName}Obj = & \${$tableName}Handler->get( \${$tableSoleName}Id ); if (is_object( \${$tableSoleName}Obj )) { - \${$tableSoleName} = \${$tableSoleName}Obj->getVar( '{$fpmf}' ); + \${$tableSoleName} = \${$tableSoleName}Obj->getVar( '{$fieldMain}' ); } } return \${$tableSoleName}; @@ -538,10 +538,10 @@ $fieldName = $fields[$f]->getVar('field_name'); $fieldInForm = $fields[$f]->getVar('field_inform'); if ((0 == $f) && (1 == $table->getVar('table_autoincrement'))) { - $fpif = $fieldName; // $fpif = fields parameter index field + $fieldId = $fieldName; // $fieldId = fields parameter index field } if (1 == $fields[$f]->getVar('field_main')) { - $fpmf = $fieldName; // $fpmf = fields parameter main field + $fieldMain = $fieldName; // $fieldMain = fields parameter main field } } $content = $this->getHeaderFilesComments($module, $filename); @@ -549,12 +549,12 @@ if (1 == $fieldInForm) { $content .= $this->getHeadInForm($module, $table); if (1 == $table->getVar('table_permissions')) { - $content .= $this->getPermissionsInForm($moduleDirname, $fpif); + $content .= $this->getPermissionsInForm($moduleDirname, $fieldId); } $content .= $this->getFootInForm(); } $content .= $this->getToArray(); - $content .= $this->getClassHandler($moduleDirname, $table, $fpif, $fpmf); + $content .= $this->getClassHandler($moduleDirname, $table, $fieldId, $fieldMain); $this->tdmcfile->create($moduleDirname, 'class', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED); 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-16 05:58:18 UTC (rev 13063) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/classes/ClassFormElements.php 2015-05-19 18:10:46 UTC (rev 13064) @@ -78,17 +78,25 @@ * @param string $required */ /** - * @param $language - * @param $fieldName - * @param string $required + * @param $language + * @param $fieldName + * @param $required * @return string */ - private function getXoopsFormText($language, $fieldName, $required = 'false') + private function getXoopsFormText($language, $fieldName, $fieldDefault, $required = 'false') { - $ret = <<<EOT + if($fieldDefault != '') { + $ret = <<<EOT // Form Text {$fieldName} + \${$fieldName} = \$this->isNew() ? '{$fieldDefault}' : \$this->getVar('{$fieldName}'); + \$form->addElement( new XoopsFormText({$language}, '{$fieldName}', 20, 150, \${$fieldName}){$required} );\n +EOT; + } else { + $ret = <<<EOT + // Form Text {$fieldName} \$form->addElement( new XoopsFormText({$language}, '{$fieldName}', 50, 255, \$this->getVar('{$fieldName}')){$required} );\n EOT; + } return $ret; } @@ -621,7 +629,7 @@ case 1: break; case 2: - $ret .= $this->getXoopsFormText($language, $fieldName, $required); + $ret .= $this->getXoopsFormText($language, $fieldName, $fieldDefault, $required); break; case 3: $ret .= $this->getXoopsFormTextArea($language, $fieldName, $required); 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-16 05:58:18 UTC (rev 13063) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/language/LanguageAdmin.php 2015-05-19 18:10:46 UTC (rev 13064) @@ -185,6 +185,7 @@ } // $ret .= $this->defines->getDefine($language, $tableSoleName .'_'. $rpFieldName, $fieldNameDesc); + $stuTableName = strtoupper($tableName); // switch ($fieldElement) { case 10: 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-16 05:58:18 UTC (rev 13063) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/templates/admin/TemplatesAdminPages.php 2015-05-19 18:10:46 UTC (rev 13064) @@ -81,7 +81,7 @@ $tableSoleName = $table->getVar('table_solename'); $ret = <<<EOT <{include file="db:{$moduleDirname}_admin_header.tpl"}> -<{if {$tableName}_list}> +<{if {$tableName}_count}> <table class="outer {$tableName} width100"> <thead> <tr class="head">\n @@ -250,15 +250,15 @@ <div class="xo-pagenav floatright"><{\$pagenav}></div><div class="clear spacer"></div> <{/if}> <{/if}> +<{if \$... [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['xoopsTpl']->assign('navigation', \$adminMenu->addNavigation('about.php')); \$GLOBALS['xoopsTpl']->assign('about', \$adminMenu->renderAbout('{$moduleDonations}', false)); include __DIR__ . '/footer.php'; 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-23 04:29:24 UTC (rev 13065) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminFooter.php 2015-05-24 17:27:05 UTC (rev 13066) @@ -84,7 +84,7 @@ $moduleDirname = $module->getVar('mod_dirname'); $content = $this->getHeaderFilesComments($module, $filename); $content .= <<<EOT -if ( isset(\$template_main) ) { +if ( isset(\$templateMain) ) { \$GLOBALS['xoopsTpl']->display("db:{\$templateMain}"); } xoops_cp_footer(); Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminObjects.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminObjects.php 2015-05-23 04:29:24 UTC (rev 13065) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminObjects.php 2015-05-24 17:27:05 UTC (rev 13066) @@ -301,8 +301,7 @@ $ret = <<<EOT \t\t\t\t// Get Var {$fieldName} \t\t\t\t\${$fieldName} = \${$tableName}All[\$i]->getVar('{$fieldName}'); -\t\t\t\t\$upload_image = \${$fieldName} ? \${$fieldName} : 'blank.gif'; -\t\t\t\t\${$lpFieldName}['{$rpFieldName}'] = \$upload_image;\n +\t\t\t\t\${$lpFieldName}['{$rpFieldName}'] = \${$fieldName} ? \${$fieldName} : 'blank.gif';\n EOT; return $ret; } 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-23 04:29:24 UTC (rev 13065) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminPages.php 2015-05-24 17:27:05 UTC (rev 13066) @@ -19,8 +19,6 @@ * @version $Id: pages.php 12258 2014-01-02 09:33:29Z timgno $ */ defined('XOOPS_ROOT_PATH') or die('Restricted access'); -require_once 'AdminObjects.php'; - /** * Class AdminPages */ @@ -83,7 +81,7 @@ public function getAdminPagesHeader($moduleDirname, $tableName, $fieldId) { $ucfModuleDirname = ucfirst($moduleDirname); - $ucfTableName = ucfirst($tableName); + $ucfTableName = ucfirst($tableName); $ret = <<<EOT include __DIR__ . '/header.php'; //It recovered the value of argument op in URL$ @@ -143,7 +141,7 @@ \${$tableName}Count = \${$tableName}Handler->getCount(\$criteria); \${$tableName}All = \${$tableName}Handler->getAll(\$criteria); unset(\$criteria); - \$GLOBALS['xoopsTpl']->assign('{$moduleDirname}_count', \${$tableName}Count); + \$GLOBALS['xoopsTpl']->assign('{$tableName}_count', \${$tableName}Count); \$GLOBALS['xoopsTpl']->assign('{$moduleDirname}_url', {$stuModuleDirname}_URL); \$GLOBALS['xoopsTpl']->assign('{$moduleDirname}_upload_url', {$stuModuleDirname}_UPLOAD_URL); // Table view @@ -248,7 +246,7 @@ $stuTableName = strtoupper($tableName); $ret = <<<EOT case 'new': - \$template_main = '{$moduleDirname}_admin_{$tableName}.tpl'; + \$templateMain = '{$moduleDirname}_admin_{$tableName}.tpl'; \$adminMenu->addItemButton({$language}{$stuTableName}_LIST, '{$tableName}.php', 'list'); \$GLOBALS['xoopsTpl']->assign('navigation', \$adminMenu->addNavigation('{$tableName}.php')); \$GLOBALS['xoopsTpl']->assign('buttons', \$adminMenu->renderButton()); @@ -353,7 +351,7 @@ $stuTableFieldname = strtoupper($tableFieldname); $ret = <<<EOT case 'edit': - \$template_main = '{$moduleDirname}_admin_{$tableName}.tpl'; + \$templateMain = '{$moduleDirname}_admin_{$tableName}.tpl'; \$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')); @@ -460,7 +458,7 @@ $moduleDirname = $module->getVar('mod_dirname'); $tableName = $table->getVar('table_name'); $language = $this->tdmcfile->getLanguage($moduleDirname, 'AM'); - $fields = $this->tdmcfile->getTableFields($table->getVar('table_id')); + $fields = $this->tdmcfile->getTableFields($table->getVar('table_mid'), $table->getVar('table_id')); foreach (array_keys($fields) as $f) { $fieldName = $fields[$f]->getVar('field_name'); $fieldInForm = $fields[$f]->getVar('field_inform'); 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-23 04:29:24 UTC (rev 13065) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminPermissions.php 2015-05-24 17:27:05 UTC (rev 13066) @@ -66,10 +66,11 @@ * @param $tables * @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); } @@ -83,9 +84,11 @@ * @param $language * @return string */ - private function getPermissionsHeader($moduleDirname, $tableName, $language) + private function getPermissionsHeader($moduleDirname, $language) { - $ret = <<<PRM + $table = $this->getTable(); + $tableName = $table->getVar('table_name'); + $ret = <<<PRM \ninclude __DIR__ . '/header.php'; include_once XOOPS_ROOT_PATH.'/class/xoopsform/grouppermform.php'; if( !empty(\$_POST['submit']) ) @@ -178,19 +181,22 @@ { $tables = $this->getTables(); foreach (array_keys($tables) as $t) { - $tableId = $tables[$t]->getVar('table_id'); + $tableId = $tables[$t]->getVar('table_id'); + $tableMid = $tables[$t]->getVar('table_mid'); if (1 == $tables[$t]->getVar('table_permissions')) { $tableName = $tables[$t]->getVar('table_name'); } } - $fields = $this->getTableFields($tableId); + $fields = $this->getTableFields($tableMid, $tableId); + $fieldId = 'id'; + $fieldMain = 'title'; foreach (array_keys($fields) as $f) { $fieldName = $fields[$f]->getVar('field_name'); if (0 == $f) { - $fpif = $fieldName; + $fieldId = $fieldName; } if (1 == $fields[$f]->getVar('field_main')) { - $fpmf = $fieldName; + $fieldMain = $fieldName; } } $ret = <<<PRM @@ -199,22 +205,20 @@ foreach (\$globalPerms as \$perm_id => \$perm_name) { \$permform->addItem(\$perm_id, \$perm_name); } - echo \$permform->render(); - echo '<br /><br />'; + \$GLOBALS['xoopsTpl']->assign('form', \$permform->render()); } else { \$criteria = new CriteriaCompo(); - \$criteria->setSort('{$fpmf}'); + \$criteria->setSort('{$fieldMain}'); \$criteria->setOrder('ASC'); \${$tableName}_count = \${$tableName}Handler->getCount(\$criteria); \${$tableName}_arr = \${$tableName}Handler->getObjects(\$criteria); unset(\$criteria); foreach (array_keys(\${$tableName}_arr) as \$i) { - \$permform->addItem(\${$tableName}_arr[\$i]->getVar('{$fpif}'), \${$tableName}_arr[\$i]->getVar('{$fpmf}')); + \$permform->addItem(\${$tableName}_arr[\$i]->getVar('{$fieldId}'), \${$tableName}_arr[\$i]->getVar('{$fieldMain}')); } // Check if {$tableName} exist before rendering the form and redirect, if there aren't {$tableName} if (\${$tableName}_count > 0) { - echo \$permform->render(); - echo '<br /><br />'; + \$GLOBALS['xoopsTpl']->assign('form', \$permform->render()); } else { redirect_header ( '{$tableName}.php?op=new', 3, {$language}NOPERMSSET ); exit (); @@ -252,13 +256,11 @@ public function render() { $module = $this->getModule(); - $table = $this->getTable(); $filename = $this->getFileName(); $moduleDirname = $module->getVar('mod_dirname'); - $tableName = $module->getVar('table_name'); $language = $this->getLanguage($moduleDirname, 'AM'); $content = $this->getHeaderFilesComments($module, $filename); - $content .= $this->getPermissionsHeader($moduleDirname, $tableName, $language); + $content .= $this->getPermissionsHeader($moduleDirname, $language); $content .= $this->getPermissionsSwitch($moduleDirname, $language); $content .= $this->getPermissionsBody($moduleDirname, $language); $content .= $this->getPermissionsFooter(); Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/blocks/BlocksFiles.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/blocks/BlocksFiles.php 2015-05-23 04:29:24 UTC (rev 13065) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/blocks/BlocksFiles.php 2015-05-24 17:27:05 UTC (rev 13066) @@ -218,7 +218,7 @@ $tableFieldname = $table->getVar('table_fieldname'); $tableCategory = $table->getVar('table_category'); $language = $this->getLanguage($moduleDirname, 'MB'); - $fields = $this->getTableFields($table->getVar('table_id')); + $fields = $this->getTableFields($table->getVar('table_mid'), $table->getVar('table_id')); foreach (array_keys($fields) as $f) { if (0 == $f) { $fpif = $fields[$f]->getVar('field_name'); 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-23 04:29:24 UTC (rev 13065) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/cache/classpaths.cache 2015-05-24 17:27:05 UTC (rev 13066) @@ -1 +1 @@ -a:50:{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: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:22:"UserNotificationUpdate";s:110:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserNotificationUpdate.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:14:"LanguageBlocks";s:106:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\language\LanguageBlocks.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:9:"UserPrint";s:97:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserPrint.php";s:13:"TDMCreateFile";s:96:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\TDMCreateFile.php";s:20:"TDMCreateTableFields";s:103:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\TDMCreateTableFields.php";s:7:"UserRss";s:95:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserRss.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: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 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-23 04:29:24 UTC (rev 13065) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/classes/ClassFiles.php 2015-05-24 17:27:05 UTC (rev 13066) @@ -16,10 +16,9 @@ * @package tdmcreate * @since 2.5.0 * @author Txmod Xoops http://www.txmodxoops.org - * @version $Id: class_files.php 12258 2014-01-02 09:33:29Z timgno $ + * @version $Id: ClassFiles.php 12258 2014-01-02 09:33:29Z timgno $ */ defined('XOOPS_ROOT_PATH') or die('Restricted access'); -require_once 'ClassFormElements.php'; /** * Class ClassFiles @@ -255,16 +254,16 @@ $ret .= <<<EOT global \$xoopsUser, \$xoopsModule; // Permissions for uploader - \$gperm_handler =& xoops_gethandler('groupperm'); + \$gpermHandler =& xoops_gethandler('groupperm'); \$groups = is_object(\$xoopsUser) ? \$xoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS; if (\$xoopsUser) { if ( !\$xoopsUser->isAdmin(\$xoopsModule->mid()) ) { - \$perm_upload = (\$gperm_handler->checkRight('{$moduleDirname}_ac', 32, \$groups, \$xoopsModule->getVar('mid'))) ? true : false ; + \$perm_upload = (\$gpermHandler->checkRight('{$moduleDirname}_ac', 32, \$groups, \$xoopsModule->getVar('mid'))) ? true : false ; }else{ \$perm_upload = true; } }else{ - \$perm_upload = (\$gperm_handler->checkRight('{$moduleDirname}_ac', 32, \$groups, \$xoopsModule->getVar('mid'))) ? true : false ; + \$perm_upload = (\$gpermHandler->checkRight('{$moduleDirname}_ac', 32, \$groups, \$xoopsModule->getVar('mid'))) ? true : false ; } EOT; } @@ -276,7 +275,7 @@ \$form = new XoopsThemeForm(\$title, 'form', \$action, 'post', true); \$form->setExtra('enctype="multipart/form-data"'); // {$ucfTableName} handler - \${$tableName}Handler =& \$this->{$moduleDirname}->getHandler('{$tableName}'); + //\${$tableName}Handler =& \$this->{$moduleDirname}->getHandler('{$tableName}'); {$this->formelements->renderElements()} EOT; @@ -300,35 +299,35 @@ $permissionView = $this->getLanguage($moduleDirname, 'AM', 'PERMISSIONS_VIEW'); $ret = <<<EOT // Permissions - \$member_handler = & xoops_gethandler ( 'member' ); - \$group_list = &\$member_handler->getGroupList(); - \$gperm_handler = &xoops_gethandler ( 'groupperm' ); - \$full_list = array_keys ( \$group_list ); + \$memberHandler = & xoops_gethandler ( 'member' ); + \$groupList = &\$memberHandler->getGroupList(); + \$gpermHandler = &xoops_gethandler ( 'groupperm' ); + \$fullList = array_keys ( \$groupList ); global \$xoopsModule; if ( !\$this->isNew() ) { - \$groups_ids_approve = \$gperm_handler->getGroupIds ( '{$moduleDirname}_approve', \$this->getVar ( '{$fieldId}' ), \$xoopsModule->getVar ( 'mid' ) ); - \$groups_ids_submit = \$gperm_handler->getGroupIds ( '{$moduleDirname}_submit', \$this->getVar ( '{$fieldId}' ), \$xoopsModule->getVar ( 'mid' ) ); - \$groups_ids_view = \$gperm_handler->getGroupIds ( '{$moduleDirname}_view', \$this->getVar ( '{$fieldId}' ), \$xoopsModule->getVar ( 'mid' ) ); - \$groups_ids_approve = array_values ( \$groups_ids_approve ); - \$groups_can_approve_checkbox = new XoopsFormCheckBox ( {$permissionApprove}, 'groups_approve[]', \$group... [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:"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 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-24 17:27:05 UTC (rev 13066) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/language/LanguageAdmin.php 2015-05-25 20:22:35 UTC (rev 13067) @@ -19,19 +19,12 @@ * @version $Id: LanguageAdmin.php 12258 2014-01-02 09:33:29Z timgno $ */ defined('XOOPS_ROOT_PATH') or die('Restricted access'); -require_once 'LanguageDefines.php'; - /** * Class LanguageAdmin */ -class LanguageAdmin extends TDMCreateFile +class LanguageAdmin extends LanguageDefines { /* - * @var mixed - */ - private $defines; - - /* * @public function constructor * @param null */ @@ -41,7 +34,6 @@ public function __construct() { parent::__construct(); - $this->tdmcfile = TDMCreateFile::getInstance(); $this->defines = LanguageDefines::getInstance(); } Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/language/LanguageBlocks.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/language/LanguageBlocks.php 2015-05-24 17:27:05 UTC (rev 13066) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/language/LanguageBlocks.php 2015-05-25 20:22:35 UTC (rev 13067) @@ -19,19 +19,12 @@ * @version $Id: LanguageBlocks.php 12258 2014-01-02 09:33:29Z timgno $ */ defined('XOOPS_ROOT_PATH') or die('Restricted access'); -require_once 'LanguageDefines.php'; - /** * Class LanguageBlocks */ -class LanguageBlocks extends TDMCreateFile +class LanguageBlocks extends LanguageDefines { /* - * @var mixed - */ - private $defines; - - /* * @public function constructor * @param null */ @@ -41,7 +34,6 @@ public function __construct() { parent::__construct(); - $this->tdmcfile = TDMCreateFile::getInstance(); $this->defines = LanguageDefines::getInstance(); } 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-24 17:27:05 UTC (rev 13066) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/language/LanguageDefines.php 2015-05-25 20:22:35 UTC (rev 13067) @@ -23,9 +23,14 @@ /** * Class LanguageDefines */ -class LanguageDefines +class LanguageDefines extends TDMCreateFile { - /* + /* + * @var mixed + */ + protected $defines; + + /* * @public function constructor * @param null */ @@ -34,6 +39,8 @@ */ public function __construct() { + parent::__construct(); + $this->tdmcfile = TDMCreateFile::getInstance(); } /* Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/language/LanguageHelp.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/language/LanguageHelp.php 2015-05-24 17:27:05 UTC (rev 13066) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/language/LanguageHelp.php 2015-05-25 20:22:35 UTC (rev 13067) @@ -19,11 +19,10 @@ * @version $Id: 1.91 LanguageHelp.php 12258 2014-01-02 09:33:29Z timgno $ */ defined('XOOPS_ROOT_PATH') or die('Restricted access'); - /** * Class LanguageHelp */ -class LanguageHelp extends TDMCreateFile +class LanguageHelp extends LanguageDefines { /* * @public function constructor @@ -34,7 +33,8 @@ */ public function __construct() { - $this->tdmcfile = TDMCreateFile::getInstance(); + parent::__construct(); + $this->defines = LanguageDefines::getInstance(); } /* Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/language/LanguageMailTpl.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/language/LanguageMailTpl.php 2015-05-24 17:27:05 UTC (rev 13066) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/language/LanguageMailTpl.php 2015-05-25 20:22:35 UTC (rev 13067) @@ -19,13 +19,12 @@ * @version $Id: 1.91 LanguageMailTpl.php 12258 2014-01-02 09:33:29Z timgno $ */ defined('XOOPS_ROOT_PATH') or die('Restricted access'); - /** * Class LanguageMailTpl */ -class LanguageMailTpl extends TDMCreateFile +class LanguageMailTpl extends LanguageDefines { - /* + /* * @public function constructor * @param null */ @@ -35,7 +34,7 @@ public function __construct() { parent::__construct(); - $this->tdmcfile = TDMCreateFile::getInstance(); + $this->defines = LanguageDefines::getInstance(); } /* 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-24 17:27:05 UTC (rev 13066) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/language/LanguageMain.php 2015-05-25 20:22:35 UTC (rev 13067) @@ -19,19 +19,12 @@ * @version $Id: LanguageMain.php 12258 2014-01-02 09:33:29Z timgno $ */ defined('XOOPS_ROOT_PATH') or die('Restricted access'); -require_once 'LanguageDefines.php'; - /** * Class LanguageMain */ -class LanguageMain extends TDMCreateFile +class LanguageMain extends LanguageDefines { /* - * @var mixed - */ - private $defines; - - /* * @public function constructor * @param null */ @@ -41,7 +34,6 @@ public function __construct() { parent::__construct(); - $this->tdmcfile = TDMCreateFile::getInstance(); $this->defines = LanguageDefines::getInstance(); } Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/language/LanguageModinfo.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/language/LanguageModinfo.php 2015-05-24 17:27:05 UTC (rev 13066) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/language/LanguageModinfo.php 2015-05-25 20:22:35 UTC (rev 13067) @@ -19,19 +19,12 @@ * @version $Id: LanguageModinfo.php 12258 2014-01-02 09:33:29Z timgno $ */ defined('XOOPS_ROOT_PATH') or die('Restricted access'); -require_once 'LanguageDefines.php'; - /** * Class LanguageModinfo */ -class LanguageModinfo extends TDMCreateFile +class LanguageModinfo extends LanguageDefines { /* - * @var mixed - */ - private $defines; - - /* * @public function constructor * @param null */ @@ -41,7 +34,6 @@ public function __construct() { parent::__construct(); - $this->tdmcfile = TDMCreateFile::getInstance(); $this->defines = LanguageDefines::getInstance(); } @@ -95,7 +87,7 @@ */ private function getLanguageMain($language, $module) { - $ret = $this->defines->getAboveHeadDefines('Admin Main'); + $ret = $this->defines->getAboveHeadDefines('Admin Main'); $ret .= $this->defines->getDefine($language, "NAME", "{$module->getVar('mod_name')}"); $ret .= $this->defines->getDefine($language, "DESC", "{$module->getVar('mod_description')}"); 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-24 17:27:05 UTC (rev 13066) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/sql/SqlFile.php 2015-05-25 20:22:35 UTC (rev 13067) @@ -190,16 +190,78 @@ } if (!empty($fieldName)) { switch ($fieldType) { - case 15: + case 2: + case 3: + case 4: + case 5: + $type = $fieldTypeName; + if(empty($fieldDefault)) { + $default = "DEFAULT '0'"; + } else { + $default = "DEFAULT '{$fieldDefault}'"; + } + break; + case 6: + case 7: + case 8: + $type = $fieldTypeName; + if(empty($fieldDefault)) { + $default = "DEFAULT '0.00'"; // From MySQL 5.7 Manual + } else { + $default = "DEFAULT '{$fieldDefault}'"; + } + break; + case 9: + case 10: + $type = $fieldTypeName; + break; + case 11: + $type = $fieldTypeName; + if(empty($fieldDefault)) { + $default = "DEFAULT 'my...@em...'"; + } else { + $default = "DEFAULT '{$fieldDefault}'"; + } + break; + case 12: + $type = $fieldTypeName; + if(empty($fieldDefault)) { + $default = "DEFAULT 'http:\\'"; + } else { + $default = "DEFAULT '{$fieldDefault}'"; + } + break; + case 13: + case 14: + $type = $fieldTypeName; + $default = "DEFAULT ''"; + break; + case 15: case 16: case 17: case 18: - case 19: - case 20: - case 21: - $type = $fieldTypeName; + $type = $fieldTypeName; $default = null; break; + case 19: + case 20: + case 21: + case 22: + $type = $fieldTypeName; + /*if(empty($fieldDefault)) { + $default = "DEFAULT '0'"; + } else {*/ + $default = "DEFAULT '{$fieldDefault}'"; + //} + break; + case 23: + $type = $fieldTypeName; + if(empty($fieldDefault)) { + $default = "DEFAULT '1970'"; // From MySQL 5.7 Manual + } else { + $default = "DEFAULT '{$fieldDefault}'"; + } + break; default: $type = $fieldTypeName . '(' . $fieldValue . ')'; $default = "DEFAULT '{$fieldDefault}'"; Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/modules.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/modules.php 2015-05-24 17:27:05 UTC (rev 13066) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/modules.php 2015-05-25 20:22:35 UTC (rev 13067) @@ -368,7 +368,7 @@ $modWebsiteUrl = $isNew ? $set['website_url'] : $this->getVar('mod_website_url'); $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_WEBSITE_URL, 'mod_website_url', 50, 255, $modWebsiteUrl)); // - $modWebsiteName = $isNew ? $set['release_file'] : $this->getVar('mod_website_name'); + $modWebsiteName = $isNew ? $set['website_name'] : $this->getVar('mod_website_name'); $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_WEBSITE_NAME, 'mod_website_name', 50, 255, $modWebsiteName)); // $modRelease = $isNew ? $set['release'] : $this->getVar('mod_release'); |
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 this module. In order to expand this module with other resources, just add the code you need to extend the functionality of the same. The files are grouped by type, from the header to the footer to see how divided the source code."); $ret .= $this->defines->getAboveHeadDefines('Contents'); foreach (array_keys($tables) as $i) { - $tableName = $tables[$i]->getVar('table_name'); - $stuTableName = strtoupper($tableName); - $ucfTableName = UcFirstAndToLower($tableName); - $ret .= $this->defines->getAboveDefines($ucfTableName); - $ret .= $this->defines->getDefine($language, $stuTableName, $ucfTableName); - $ret .= $this->defines->getDefine($language, "{$stuTableName}_DESC", "{$ucfTableName} description"); - $ret .= $this->defines->getAboveDefines("Caption of {$ucfTableName}"); + $tableSoleName = $tables[$i]->getVar('table_solename'); + $stuTableSoleName = strtoupper($tableSoleName); + $ucfTableSoleName = UcFirstAndToLower($tableSoleName); + $ret .= $this->defines->getAboveDefines($ucfTableSoleName); + $ret .= $this->defines->getDefine($language, $stuTableSoleName, $ucfTableSoleName); + $ret .= $this->defines->getDefine($language, "{$stuTableSoleName}_DESC", "{$ucfTableSoleName} description"); + $ret .= $this->defines->getAboveDefines("Caption of {$ucfTableSoleName}"); $fields = $this->getTableFields($tables[$i]->getVar('table_mid'), $tables[$i]->getVar('table_id')); foreach (array_keys($fields) as $f) { - $fieldName = $fields[$f]->getVar('field_name'); - $stuFieldName = strtoupper($fieldName); - // - $rpFieldName = $this->tdmcfile->getRightString($fieldName); - $lpFieldName = substr($fieldName, 0, strpos($fieldName, '_')); - // + $fieldName = $fields[$f]->getVar('field_name'); + $rpFieldName = $this->tdmcfile->getRightString($fieldName); $fieldNameDesc = ucfirst($rpFieldName); - // - $ret .= $this->defines->getDefine($language, $stuFieldName, $fieldNameDesc); + + $ret .= $this->defines->getDefine($language, $stuTableSoleName . '_' . $rpFieldName, $fieldNameDesc); } } 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-27 10:06:24 UTC (rev 13071) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/templates/admin/TemplatesAdminPages.php 2015-05-27 14:19:05 UTC (rev 13072) @@ -19,8 +19,6 @@ * @version $Id: TemplatesAdminPages.php 12258 2014-01-02 09:33:29Z timgno $ */ defined('XOOPS_ROOT_PATH') or die('Restricted access'); -include_once TDMC_PATH . '/class/files/templates/TDMCreateHtmlSmartyCodes.php'; - /** * Class TemplatesAdminPages */ @@ -85,18 +83,24 @@ <thead> <tr class="head">\n EOT; - foreach (array_keys($fields) as $f) { - $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 + $langHeadId = $language . strtoupper($tableSoleName) . '_ID'; + if (1 == $table->getVar('table_autoincrement')) { + $ret .= <<<EOT + <th class="center"><{\$smarty.const.{$langHeadId}}></th>\n EOT; - } + } + foreach (array_keys($fields) as $f) { + $fieldName = $fields[$f]->getVar('field_name'); + $rpFieldName = $this->tdmcfile->getRightString($fieldName); + $langFieldName = $language . strtoupper($tableSoleName) . '_' . strtoupper($rpFieldName); + if (1 == $fields[$f]->getVar('field_inlist')) { + $ret .= <<<EOT + <th class="center"><{\$smarty.const.{$langFieldName}}></th>\n +EOT; + } } $ret .= <<<EOT - <th class="center"><{\$smarty.const.{$language}FORMACTION}></th> + <th class="center"><{\$smarty.const.{$language}FORM_ACTION}></th> </tr> </thead>\n EOT; @@ -121,14 +125,19 @@ <{foreach item=list from=\${$tableName}_list}> <tr class="<{cycle values='odd, even'}>">\n EOT; - foreach (array_keys($fields) as $f) { + if (1 == $table->getVar('table_autoincrement')) { + $ret .= <<<EOT + <td class="center"><{\$list.id}></td>\n +EOT; + } + foreach (array_keys($fields) as $f) { $fieldName = $fields[$f]->getVar('field_name'); $fieldElement = $fields[$f]->getVar('field_element'); $rpFieldName = $this->tdmcfile->getRightString($fieldName); if (0 == $f) { - $field_id = $fieldName; + $fieldId = $fieldName; } - if ((1 == $table->getVar('table_autoincrement')) || (1 == $fields[$f]->getVar('field_inlist'))) { + if (1 == $fields[$f]->getVar('field_inlist')) { switch ($fieldElement) { case 9: $ret .= <<<EOT @@ -155,10 +164,10 @@ } $ret .= <<<EOT <td class="center"> - <a href="{$tableName}.php?op=edit&{$field_id}=<{\$list.id}>" title="<{\$smarty.const._EDIT}>"> + <a href="{$tableName}.php?op=edit&{$fieldId}=<{\$list.id}>" title="<{\$smarty.const._EDIT}>"> <img src="<{xoModuleIcons16 edit.png}>" alt="<{\$smarty.const._EDIT}>" /> </a> - <a href="{$tableName}.php?op=delete&{$field_id}=<{\$list.id}>" title="<{\$smarty.const._DELETE}>"> + <a href="{$tableName}.php?op=delete&{$fieldId}=<{\$list.id}>" title="<{\$smarty.const._DELETE}>"> <img src="<{xoModuleIcons16 delete.png}>" alt="<{\$smarty.const._DELETE}>" /> </a> </td> @@ -189,13 +198,18 @@ <{foreach item=list from=\${$tableName}_list}> <tr class="<{cycle values='odd, even'}>">\n EOT; - foreach (array_keys($fields) as $f) { + if (1 == $table->getVar('table_autoincrement')) { + $ret .= <<<EOT + <td class="center"><{\$list.id}></td>\n +EOT; + } + foreach (array_keys($fields) as $f) { $fieldName = $fields[$f]->getVar('field_name'); $fieldElement = $fields[$f]->getVar('field_element'); if (0 == $f) { - $field_id = $fieldName; + $fieldId = $fieldName; } - if ((1 == $table->getVar('table_autoincrement')) || (1 == $fields[$f]->getVar('field_inlist'))) { + if (1 == $fields[$f]->getVar('field_inlist')) { switch ($fieldElement) { case 9: $ret .= <<<EOT @@ -222,10 +236,10 @@ } $ret .= <<<EOT <td class="center"> - <a href="{$tableName}.php?op=edit&{$field_id}=<{\$list.{$field_id}}>" title="<{\$smarty.const._EDIT}>"> + <a href="{$tableName}.php?op=edit&{$fieldId}=<{\$list.{$fieldId}}>" title="<{\$smarty.const._EDIT}>"> <img src="<{xoModuleIcons16 edit.png}>" alt="<{\$smarty.const._EDIT}>" /> </a> - <a href="{$tableName}.php?op=delete&{$field_id}=<{\$list.{$field_id}}>" title="<{\$smarty.const._DELETE}>"> + <a href="{$tableName}.php?op=delete&{$fieldId}=<{\$list.{$fieldId}}>" title="<{\$smarty.const._DELETE}>"> <img src="<{xoModuleIcons16 delete.png}>" alt="<{\$smarty.const._DELETE}>" /> </a> </td> |
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_comments', (1 == $_REQUEST['table_comments'][$key]) ? 0 : 1); - $tablesObj->setVar('table_notifications', (1 == $_REQUEST['table_notifications'][$key]) ? 0 : 1); + + $tableId = tdmcreate_CleanVars($_POST, 'table_id', 0, 'int'); + if ($tableId > 0) { + $tablesObj = $tdmcreate->getHandler('tables')->get($tableId); + if (isset($_POST['table_admin'])) { + $table_admin = $tablesObj->getVar('table_admin'); + $tablesObj->setVar('table_admin', !$table_admin); + } + if (isset($_POST['table_user'])) { + $table_user = $tablesObj->getVar('table_user'); + $tablesObj->setVar('table_user', !$table_user); + } + if (isset($_POST['table_blocks'])) { + $table_blocks = $tablesObj->getVar('table_blocks'); + $tablesObj->setVar('table_blocks', !$table_blocks); + } + if (isset($_POST['table_search'])) { + $table_search = $tablesObj->getVar('table_search'); + $tablesObj->setVar('table_search', !$table_search); + } + if (isset($_POST['table_comments'])) { + $table_comments = $tablesObj->getVar('table_comments'); + $tablesObj->setVar('table_comments', !$table_comments); + } + if (isset($_POST['table_notifications'])) { + $table_notifications = $tablesObj->getVar('table_notifications'); + $tablesObj->setVar('table_notifications', !$table_notifications); + } + if (isset($_POST['table_permissions'])) { + $table_permissions = $tablesObj->getVar('table_permissions'); + $tablesObj->setVar('table_permissions', !$table_permissions); + } + if ($tdmcreate->getHandler('tables')->insert($tablesObj)) { + redirect_header('tables.php', 3, _AM_TDMCREATE_TOGGLE_SUCCESS); } - } - if ($tables->insert($tablesObj, true)) { - redirect_header('tables.php', 1, _AM_TDMCREATE_TOGGLE_SUCCESS); - } else { - redirect_header('tables.php', 1, _AM_TDMCREATE_TOGGLE_FAILED); - } + $GLOBALS['xoopsTpl']->assign('error', $tablesObj->getHtmlErrors()); + } break; } include __DIR__ . '/footer.php'; Added: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/icons/16/rss.gif =================================================================== (Binary files differ) Index: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/icons/16/rss.gif =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/icons/16/rss.gif 2015-05-30 10:15:43 UTC (rev 13073) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/icons/16/rss.gif 2015-06-01 11:22:57 UTC (rev 13074) Property changes on: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/icons/16/rss.gif ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Added: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/icons/24/index.html =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/icons/24/index.html (rev 0) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/icons/24/index.html 2015-06-01 11:22:57 UTC (rev 13074) @@ -0,0 +1 @@ +<script>history.go(-1);</script> \ No newline at end of file Added: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/icons/24/next.png =================================================================== (Binary files differ) Index: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/icons/24/next.png =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/icons/24/next.png 2015-05-30 10:15:43 UTC (rev 13073) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/icons/24/next.png 2015-06-01 11:22:57 UTC (rev 13074) Property changes on: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/icons/24/next.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/assets/icons/24/previous.png =================================================================== (Binary files differ) Index: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/icons/24/previous.png =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/icons/24/previous.png 2015-05-30 10:15:43 UTC (rev 13073) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/icons/24/previous.png 2015-06-01 11:22:57 UTC (rev 13074) Property changes on: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/icons/24/previous.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Deleted: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/cache/classpaths.cache =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/cache/classpaths.cache 2015-05-30 10:15:43 UTC (rev 13073) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/cache/classpaths.cache 2015-06-01 11:22:57 UTC (rev 13074) @@ -1 +0,0 @@ -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/fields.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/fields.php 2015-05-30 10:15:43 UTC (rev 13073) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/fields.php 2015-06-01 11:22:57 UTC (rev 13074) @@ -452,6 +452,30 @@ return $form; } + + /** + * Get Values + */ + public function getValues($keys = null, $format = null, $maxDepth = null) + { + $ret = parent::getValues($keys, $format, $maxDepth); + $ret['id'] = $this->getVar('field_id'); + $ret['mid'] = $this->getVar('field_mid'); + $ret['tid'] = $this->getVar('field_tid'); + $ret['order'] = $this->getVar('field_order'); + $ret['name'] = str_replace('_', ' ', ucfirst($this->getVar('field_name'))); + $ret['parent'] = $this->getVar('field_parent'); + $ret['inlist'] = $this->getVar('field_inlist'); + $ret['inform'] = $this->getVar('field_inform'); + $ret['admin'] = $this->getVar('field_admin'); + $ret['user'] = $this->getVar('field_user'); + $ret['block'] = $this->getVar('field_block'); + $ret['main'] = $this->getVar('field_main'); + $ret['search'] = $this->getVar('field_search'); + $ret['required'] = $this->getVar('field_required'); + + return $ret; + } } /* @@ -537,4 +561,45 @@ return true; } + + /** + * Get Count Fields + */ + public function getCountFields($start = 0, $limit = 0, $sort = 'field_id ASC, field_name', $order = 'ASC') + { + $criteria = new CriteriaCompo(); + $criteria->setSort($sort); + $criteria->setOrder($order); + $criteria->setStart($start); + $criteria->setLimit($limit); + return parent::getCount($criteria); + } + + /** + * Get All Fields + */ + public function getAllFields($start = 0, $limit = 0, $sort = 'field_id ASC, field_name', $order = 'ASC') + { + $criteria = new CriteriaCompo(); + $criteria->setSort($sort); + $criteria->setOrder($order); + $criteria->setStart($start); + $criteria->setLimit($limit); + return parent::getAll($criteria); + } + + /** + * Get All Fields By Module & Table Id + */ + public function getAllFieldsByModuleAndTableId($modId, $tabId, $start = 0, $limit = 0, $sort = 'field_id ASC, field_name', $order = 'ASC') + { + $criteria = new CriteriaCompo(); + $criteria->add(new Criteria('field_mid', $modId)); + $criteria->add(new Criteria('field_tid', $tabId)); + $criteria->setSort($sort); + $criteria->setOrder($order); + $criteria->setStart($start); + $criteria->setLimit($limit); + return parent::getAll($criteria); + } } 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-30 10:15:43 UTC (rev 13073) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateArchitecture.php 2015-06-01 11:22:57 UTC (rev 13074) @@ -273,8 +273,8 @@ if (1 == $tableUser) { // User Pages File $userPages = UserPages::getInstance(); - $userPages->write($module, $table); - $ret[] = $userPages->renderFile($tableName . '.php'); + $userPages->write($module, $table, $tableName . '.php'); + $ret[] = $userPages->renderFile(); // User Templates File $userTemplatesPages = TemplatesUserPages::getInstance(); $userTemplatesPages->write($module, $table); @@ -532,7 +532,7 @@ } // User Index File $userIndex = UserIndex::getInstance(); - $userIndex->write($module, 'index.php'); + $userIndex->write($module, $table, 'index.php'); $ret[] = $userIndex->render(); // Language Main File $languageMain = LanguageMain::getInstance(); Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminObjects.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminObjects.php 2015-05-30 10:15:43 UTC (rev 13073) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminObjects.php 2015-06-01 11:22:57 UTC (rev 13074) @@ -104,8 +104,8 @@ \$uploaddir = {$stuModuleDirname}_UPLOAD_PATH.'/files/{$tableName}'; \$uploader = new XoopsMediaUploader(\$uploaddir, \${$moduleDirname}->getConfig('mimetypes'), \${$moduleDirname}->getConfig('maxsize'), null, null); - if (\$uploader->fetchMedia(\$_POST['xoops_upload_file'][])) { - \$uploader->fetchMedia(\$_POST['xoops_upload_file'][]); + 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); @@ -133,9 +133,9 @@ \$uploaddir = XOOPS_ROOT_PATH . '/Frameworks/moduleclasses/icons/32'; \$uploader = new XoopsMediaUploader(\$uploaddir, \${$moduleDirname}->getConfig('mimetypes'), \${$moduleDirname}->getConfig('maxsize'), null, null); - if (\$uploader->fetchMedia(\$_POST['xoops_upload_file'][])) { + if (\$uploader->fetchMedia(\$_POST['xoops_upload_file'][1])) { //\$uploader->setPrefix('{$fieldName}_'); - //\$uploader->fetchMedia(\$_POST['xoops_upload_file'][]); + //\$uploader->fetchMedia(\$_POST['xoops_upload_file'][1]); if (!\$uploader->upload()) { \$errors = \$uploader->getErrors(); redirect_header('javascript:history.go(-1)', 3, \$errors); @@ -156,7 +156,7 @@ * @param string $fieldName * @return string */ - public function getUploadImageSetVar($moduleDirname, $tableName, $fieldName, $fpmf) + public function getUploadImageSetVar($moduleDirname, $tableName, $fieldName, $fieldMain) { $stuModuleDirname = strtoupper($moduleDirname); $ret = <<<EOT @@ -165,11 +165,11 @@ \$uploaddir = {$stuModuleDirname}_UPLOAD_PATH.'/images/{$tableName}'; \$uploader = new XoopsMediaUploader(\$uploaddir, \${$moduleDirname}->getConfig('mimetypes'), \${$moduleDirname}->getConfig('maxsize'), null, null); - if (\$uploader->fetchMedia(\$_POST['xoops_upload_file'][0])) { + if (\$uploader->fetchMedia(\$_POST['xoops_upload_file'][2])) { \$extension = preg_replace( '/^.+\.([^.]+)$/sU' , '' , \$_FILES['attachedfile']['name']); - \$imgName = str_replace(' ', '', \$_POST['{$fpmf}']).'.'.\$extension; + \$imgName = str_replace(' ', '', \$_POST['{$fieldMain}']).'.'.\$extension; \$uploader->setPrefix(\$imgName); - \$uploader->fetchMedia(\$_POST['xoops_upload_file'][0]); + \$uploader->fetchMedia(\$_POST['xoops_upload_file'][2]); if (!\$uploader->upload()) { \$errors = \$uploader->getErrors(); redirect_header('javascript:history.go(-1)', 3, \$errors); @@ -199,9 +199,9 @@ \$uploaddir = {$stuModuleDirname}_UPLOAD_PATH.'/files/{$tableName}'; \$uploader = new XoopsMediaUploader(\$uploaddir, \${$moduleDirname}->getConfig('mimetypes'), \${$moduleDirname}->getConfig('maxsize'), null, null); - if (\$uploader->fetchMedia(\$_POST['xoops_upload_file'][])) { + if (\$uploader->fetchMedia(\$_POST['xoops_upload_file'][3])) { //\$uploader->setPrefix('{$fieldName}_') ; - //\$uploader->fetchMedia(\$_POST['xoops_upload_file'][]); + //\$uploader->fetchMedia(\$_POST['xoops_upload_file'][3]); if (!\$uploader->upload()) { \$errors = \$uploader->getErrors(); redirect_header('javascript:history.go(-1)', 3, \$errors); 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-30 10:15:43 UTC (rev 13073) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminPages.php 2015-06-01 11:22:57 UTC (rev 13074) @@ -136,7 +136,6 @@ $ret .= <<<EOT \${$tableName}Count = \${$tableName}Handler->getCount{$ucfTableName}(); \${$tableName}All = \${$tableName}Handler->getAll{$ucfTableName}(\$start, \$limit); - unset(\$criteria); \$GLOBALS['xoopsTpl']->assign('{$tableName}_count', \${$tableName}Count); \$GLOBALS['xoopsTpl']->assign('{$moduleDirname}_url', {$stuModuleDirname}_URL); \$GLOBALS['xoopsTpl']->assign('{$moduleDirname}_upload_url', {$stuModuleDirname}_UPLOAD_URL); @@ -146,7 +145,7 @@ foreach (array_keys(\${$tableName}All) as \$i) { \${$tableSoleName} = \${$tableName}All[\$i]->getValues(); - \$GLOBALS['xoopsTpl']->appendByRef('{$tableName}_list', \${$tableSoleName}); + \$GLOBALS['xoopsTpl']->append('{$tableName}_list', \${$tableSoleName}); unset(\${$tableSoleName}); } if ( \${$tableName}Count > \$limit ) { @@ -204,7 +203,7 @@ $ret = <<<EOT case 'save': if ( !\$GLOBALS['xoopsSecurity']->check() ) { - redirect_header('{$tableName}.php', 3, implode(',', \$GLOBALS['xoopsSecurity']->getErrors())); + redirect_header('{$tableName}.php', 3, implode(',', \$GLOBALS['xoopsSecurity']->getErrors())); } if (isset(\${$fieldId})) { \${$tableName}Obj =& \${$tableName}Handler->get(\${$fieldId}); @@ -249,7 +248,7 @@ $ret .= <<<EOT // Insert Data if (\${$tableName}Handler->insert(\${$tableName}Obj)) { - redirect_header('{$tableName}.php?op=list', 2, {$language}FORMOK); + redirect_header('{$tableName}.php?op=list', 2, {$language}FORM_OK); } // Get Form \$GLOBALS['xoopsTpl']->assign('error', \${$tableName}Obj->getHtmlErrors()); Deleted: 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-30 10:15:43 UTC (rev 13073) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/cache/classpaths.cache 2015-06-01 11:22:57 UTC (rev 13074) @@ -1 +0,0 @@ -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/ClassFiles.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/classes/ClassFiles.php 2015-05-30 10:15:43 UTC (rev 13073) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/classes/ClassFiles.php 2015-06-01 11:22:57 UTC (rev 13074) @@ -809,8 +809,9 @@ $fieldParentId = array(); $fieldElementId = array(); foreach (array_keys($fields) as $f) { - $fieldName = $fields[$f]->getVar('field_name'); - $fieldInForm[] = $fields[$f]->getVar('field_inform'); + $fieldName = $fields[$f]->getVar('field_name'); + $fieldInForm[] = $fields[$f]->getVar('field_inform'); + $fieldParentId[] = $fields[$f]->getVar('field_parent'); if ((0 == $f) && (1 == $table->getVar('table_autoincrement'))) { $fieldId = $fieldName; // $fieldId = fields parameter index field } @@ -818,7 +819,7 @@ $fieldMain = $fieldName; // $fieldMain = fields parameter main field } if (1 == $fields[$f]->getVar('field_parent')) { - $fieldParent = $fieldName; // $fieldParent = fields parameter parent field + $fieldParent = $fieldName; // $fieldParent = fields parameter parent field } $fieldElement = $fields[$f]->getVar('field_element'); // 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-30 10:15:43 UTC (rev 13073) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/classes/ClassFormElements.php 2015-06-01 11:22:57 UTC (rev 13074) @@ -303,7 +303,7 @@ } /* - * @private function getXoopsFormTextFile + * @private function getXoopsFormUrlFile * @param string $language * @param string $moduleDirname * @param string $fieldName @@ -323,13 +323,13 @@ private function getXoopsFormUrlFile($language, $moduleDirname, $fieldName, $fieldDefault, $fieldElement, $required = 'false') { $ret = <<<EOT - // Form Text File - \$formTextFile = new XoopsFormElementTray({$language}FORM_FILE,'<br /><br />'); - \$field_text = \$this->isNew() ? '{$fieldDefault}' : \$this->getVar('{$fieldName}'); - \$formText = new XoopsFormText({$language}FORM_TEXT, '{$fieldName}', 75, 255, \$field_text); - \$formTextFile->addElement(\$formText{$required} ); - \$formTextFile->addElement(new XoopsFormFile({$language}FORM_UPLOAD , 'attachedfile', \$this->{$moduleDirname}->getConfig('maxsize')){$required}); - \$form->addElement(\$formTextFile);\n + // Form Url Text File + \$formUrlFile = new XoopsFormElementTray({$language}FORM_FILE,'<br /><br />'); + \$formFile = \$this->isNew() ? '{$fieldDefault}' : \$this->getVar('{$fieldName}'); + \$formFormText = new XoopsFormText({$language}FORM_TEXT, '{$fieldName}', 75, 255, \$formFile); + \$formUrlFile->addElement(\$formFormText{$required} ); + \$formUrlFile->addElement(new XoopsFormFile({$language}FORM_UPLOAD , 'attachedfile', \$this->{$moduleDirname}->getConfig('maxsize')){$required}); + \$form->addElement(\$formUrlFile);\n EOT; return $ret; Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/include/IncludeFunctions.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/include/IncludeFunctions.php 2015-05-30 10:15:43 UTC (rev 13073) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/include/IncludeFunctions.php 2015-06-01 11:22:57 UTC (rev 13074) @@ -140,7 +140,7 @@ public function getFunctionMetaKeywords($moduleDirname) { $ret = <<<EOT -\nfunction {$moduleDirname}_meta_keywords(\$co... [truncated message content] |