|
From: <txm...@us...> - 2014-07-08 19:32:17
|
Revision: 12687
http://sourceforge.net/p/xoops/svn/12687
Author: txmodxoops
Date: 2014-07-08 19:32:05 +0000 (Tue, 08 Jul 2014)
Log Message:
-----------
- Fixed bugs
- Updated
- Still work to do
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/blocks/blocks.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/classes/formelements.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/htmlsmartycodes.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/admin/pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/user/pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/language/english/admin.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/fields.php 2014-07-07 15:24:03 UTC (rev 12686)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/fields.php 2014-07-08 19:32:05 UTC (rev 12687)
@@ -158,7 +158,7 @@
if ( !$GLOBALS['xoopsSecurity']->check() ) {
redirect_header('fields.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
}
- $field_id = XoopsRequest::getInt('field_id');
+ $fieldId = XoopsRequest::getInt('field_id');
// Fields Handler
$fields = $tdmcreate->getHandler('fields');
// Set Variables
@@ -213,9 +213,9 @@
if (!$tdmcreate->getHandler('fieldelements')->insert($fieldelementObj) ) {
$GLOBALS['xoopsTpl']->assign('error', $fieldelementObj->getHtmlErrors() . ' Field element');
}
- redirect_header('fields.php', 2, sprintf(_AM_TDMCREATE_FIELD_FORM_SAVED_OK, $table_name));
+ redirect_header('fields.php', 2, sprintf(_AM_TDMCREATE_FIELDS_FORM_SAVED_OK, $table_name));
} else {
- redirect_header('fields.php', 2, sprintf(_AM_TDMCREATE_FIELD_FORM_UPDATED_OK, $table_name));
+ redirect_header('fields.php', 2, sprintf(_AM_TDMCREATE_FIELDS_FORM_UPDATED_OK, $table_name));
}
//
$GLOBALS['xoopsTpl']->assign('error', $fieldsObj->getHtmlErrors());
@@ -232,8 +232,8 @@
$adminMenu->addItemButton(_AM_TDMCREATE_FIELDS_LIST, 'fields.php', 'list');
$GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
// Form Edit
- $field_id = XoopsRequest::getInt('field_id');
- $fieldsObj = $tdmcreate->getHandler('fields')->get( $field_id );
+ $fieldId = XoopsRequest::getInt('field_id');
+ $fieldsObj = $tdmcreate->getHandler('fields')->get( $fieldId );
$form = $fieldsObj->getFormEdit($field_mid, $fieldTid);
$GLOBALS['xoopsTpl']->assign('form', $form->render());
// Test -> Will be removed
@@ -242,9 +242,9 @@
case 'drag':
$side = TDMCreate_CleanVars( $_POST, 'field_id', 0, 'int' );
- $field_id = XoopsRequest::getInt('field_id');
- if ( $field_id > 0 ) {
- $fieldsObj = $tdmcreate->getHandler('fields')->get( $field_id );
+ $fieldId = XoopsRequest::getInt('field_id');
+ if ( $fieldId > 0 ) {
+ $fieldsObj = $tdmcreate->getHandler('fields')->get( $fieldId );
$fieldsObj->setVar('field_id', $side);
if (!$tdmcreate->getHandler('fields')->insert( $fieldsObj )) {
redirect_header('fields.php', 5, _AM_TDMCREATE_FIELD_SIDE_ERROR);
@@ -271,11 +271,12 @@
break;
case 'display':
+ $fieldId = XoopsRequest::getInt('field_id');
// Get the list of fields
$criteria = new CriteriaCompo();
$criteria->add(new Criteria('field_tid', $fieldTid));
$fields = $tdmcreate->getHandler('fields')->getObjects($criteria);
- $fieldsObj =& $tdmcreate->getHandler('fields')->get($field_id);
+ $fieldsObj =& $tdmcreate->getHandler('fields')->get($fieldId);
if (isset($_GET['field_tid'])) {
if (isset($_GET['field_parent'])) {
foreach ($fields as $field) {
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/pages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/pages.php 2014-07-07 15:24:03 UTC (rev 12686)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/pages.php 2014-07-08 19:32:05 UTC (rev 12687)
@@ -61,12 +61,14 @@
* @param string $moduleDirname
* @param string $tableName
*/
- public function getAdminPagesHeader($moduleDirname, $tableName) {
+ public function getAdminPagesHeader($moduleDirname, $tableName, $fpif) {
$ret = <<<EOT
include_once 'header.php';
//It recovered the value of argument op in URL$
-\$op = {$moduleDirname}_CleanVars(\$_REQUEST, 'op', 'list', 'string');
+\$op = XoopsRequest::getString('op', 'list');
+// Request {$fpif}
+\${$fpif} = XoopsRequest::getInt('{$fpif}');
// Switch options
switch (\$op)
{\n
@@ -84,18 +86,18 @@
* @param string $fpif
* @param string $fpmf
*/
- public function getAdminPagesList($moduleDirname, $tableName, $tableFieldname, $language, $fields, $fpif, $fpmf) {
- $stu_module_dirname = strtoupper($moduleDirname);
- $stu_table_name = strtoupper($tableName);
- $stu_table_fieldname = strtoupper($tableFieldname);
+ public function getAdminPagesList($moduleDirname, $tableName, $tableFieldname, $tableAutoincrement, $language, $fields, $fpif, $fpmf) {
+ $stuModuleDirname = strtoupper($moduleDirname);
+ $stuTableName = strtoupper($tableName);
+ $stuTableFieldname = strtoupper($tableFieldname);
$ret = <<<EOT
case 'list':
default:
- \$limit = \${$moduleDirname}->getConfig('adminpager');
- \$start = {$moduleDirname}_CleanVars(\$_REQUEST, 'start', 0);
+ \$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_{$stu_table_fieldname}, '{$tableName}.php?op=new', 'add');
+ \$adminMenu->addItemButton({$language}ADD_{$stuTableFieldname}, '{$tableName}.php?op=new', 'add');
\$GLOBALS['xoopsTpl']->assign('buttons', \$adminMenu->renderButton());
\$criteria = new CriteriaCompo();
\$criteria->setSort('{$fpif} ASC, {$fpmf}');
@@ -103,8 +105,8 @@
\${$tableName}_rows = \${$tableName}Handler->getCount(\$criteria);
\${$tableName}_arr = \${$tableName}Handler->getAll(\$criteria);
unset(\$criteria);
- \$GLOBALS['xoopsTpl']->assign('{$moduleDirname}_url', {$stu_module_dirname}_URL);
- \$GLOBALS['xoopsTpl']->assign('{$moduleDirname}_upload_url', {$stu_module_dirname}_UPLOAD_URL);
+ \$GLOBALS['xoopsTpl']->assign('{$moduleDirname}_url', {$stuModuleDirname}_URL);
+ \$GLOBALS['xoopsTpl']->assign('{$moduleDirname}_upload_url', {$stuModuleDirname}_UPLOAD_URL);
// Table view
if (\${$tableName}_rows > 0)
{
@@ -115,23 +117,25 @@
{
$fieldName = $fields[$f]->getVar('field_name');
$rp_field_name = $fieldName;
- // Verify if table_fieldname is not empty
- if(!empty($tableFieldname)) {
- if(strpos($fieldName, '_')) {
- $str = strpos($fieldName, '_');
- if($str !== false){
- $rp_field_name = substr($fieldName, $str + 1, strlen($fieldName));
- }
- }
- $lp_field_name = substr($fieldName, 0, strpos($fieldName, '_'));
- $ret .= <<<EOT
+ if( ($fields[$f]->getVar('field_admin') == 1) || ($tableAutoincrement == 1) ) {
+ // Verify if table_fieldname is not empty
+ if(!empty($tableFieldname)) {
+ if(strpos($fieldName, '_')) {
+ $str = strpos($fieldName, '_');
+ if($str !== false){
+ $rp_field_name = substr($fieldName, $str + 1, strlen($fieldName));
+ }
+ }
+ $lp_field_name = substr($fieldName, 0, strpos($fieldName, '_'));
+ $ret .= <<<EOT
\${$lp_field_name}['{$rp_field_name}'] = \${$tableName}_arr[\$i]->getVar('{$fieldName}');\n
EOT;
- } else {
- $lp_field_name = $tableName;
- $ret .= <<<EOT
+ } else {
+ $lp_field_name = $tableName;
+ $ret .= <<<EOT
\${$lp_field_name}['{$rp_field_name}'] = \${$tableName}_arr[\$i]->getVar('{$fieldName}');\n
EOT;
+ }
}
}
$ret .= <<<EOT
@@ -146,7 +150,7 @@
\$GLOBALS['xoopsTpl']->assign('pagenav', \$pagenav->renderNav(4));
}
} else {
- \$GLOBALS['xoopsTpl']->assign('error', {$language}THEREARENT_{$stu_table_name});
+ \$GLOBALS['xoopsTpl']->assign('error', {$language}THEREARENT_{$stuTableName});
}
break;\n
EOT;
@@ -160,11 +164,11 @@
* @param string $language
*/
public function getAdminPagesNew($moduleDirname, $tableName, $language) {
- $stu_table_name = strtoupper($tableName);
+ $stuTableName = strtoupper($tableName);
$ret = <<<EOT
case 'new':
\$template_main = '{$moduleDirname}_admin_{$tableName}.tpl';
- \$adminMenu->addItemButton({$language}{$stu_table_name}_LIST, '{$tableName}.php', 'list');
+ \$adminMenu->addItemButton({$language}{$stuTableName}_LIST, '{$tableName}.php', 'list');
\$GLOBALS['xoopsTpl']->assign('navigation', \$adminMenu->addNavigation('{$tableName}.php'));
\$GLOBALS['xoopsTpl']->assign('buttons', \$adminMenu->renderButton());
// Get Form
@@ -192,8 +196,8 @@
if ( !\$GLOBALS['xoopsSecurity']->check() ) {
redirect_header('{$tableName}.php', 3, implode(',', \$GLOBALS['xoopsSecurity']->getErrors()));
}
- if (isset(\$_REQUEST['{$fpif}'])) {
- \${$tableName}Obj =& \${$tableName}Handler->get(\$_REQUEST['{$fpif}']);
+ if (isset(\${$fpif})) {
+ \${$tableName}Obj =& \${$tableName}Handler->get(\${$fpif});
} else {
\${$tableName}Obj =& \${$tableName}Handler->create();
}
@@ -251,17 +255,17 @@
* @param string $fpif
*/
public function getAdminPagesEdit($moduleDirname, $tableName, $tableFieldname, $language, $fpif) {
- $stu_table_name = strtoupper($tableName);
- $stu_table_fieldname = strtoupper($tableFieldname);
+ $stuTableName = strtoupper($tableName);
+ $stuTableFieldname = strtoupper($tableFieldname);
$ret = <<<EOT
case 'edit':
\$template_main = '{$moduleDirname}_admin_{$tableName}.tpl';
- \$adminMenu->addItemButton({$language}ADD_{$stu_table_fieldname}, '{$tableName}.php?op=new', 'add');
- \$adminMenu->addItemButton({$language}{$stu_table_name}_LIST, '{$tableName}.php', 'list');
+ \$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(\$_REQUEST['{$fpif}']);
+ \${$tableName}Obj = \${$tableName}Handler->get(\${$fpif});
\$form = \${$tableName}Obj->getForm();
\$GLOBALS['xoopsTpl']->assign('form', \$form->render());
break;\n
@@ -278,7 +282,7 @@
$ret = <<<EOT
case 'delete':
- \${$tableName}Obj =& \${$tableName}Handler->get(\$_REQUEST['{$fpif}']);
+ \${$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()));
@@ -289,7 +293,7 @@
echo \${$tableName}Obj->getHtmlErrors();
}
} else {
- xoops_confirm(array('ok' => 1, '{$fpif}' => \$_REQUEST['{$fpif}'], 'op' => 'delete'), \$_SERVER['REQUEST_URI'], sprintf({$language}FORMSUREDEL, \${$tableName}Obj->getVar('{$fpmf}')));
+ xoops_confirm(array('ok' => 1, '{$fpif}' => \${$fpif}, 'op' => 'delete'), \$_SERVER['REQUEST_URI'], sprintf({$language}FORMSUREDEL, \${$tableName}Obj->getVar('{$fpmf}')));
}
break;\n
EOT;
@@ -318,7 +322,8 @@
$table = $this->getTable();
$moduleDirname = $module->getVar('mod_dirname');
$tableName = $table->getVar('table_name');
- $tableFieldname = $table->getVar('table_fieldname');
+ $tableFieldname = $table->getVar('table_fieldname');
+ $tableAutoincrement = $table->getVar('table_autoincrement');
$language = $this->getLanguage($moduleDirname, 'AM');
$fields = $this->getTableFields($table->getVar('table_id'));
foreach(array_keys($fields) as $f)
@@ -332,8 +337,8 @@
}
}
$content = $this->getHeaderFilesComments($module, $filename);
- $content .= $this->getAdminPagesHeader($moduleDirname, $tableName);
- $content .= $this->getAdminPagesList($moduleDirname, $tableName, $tableFieldname, $language, $fields, $fpif, $fpmf);
+ $content .= $this->getAdminPagesHeader($moduleDirname, $tableName, $fpif);
+ $content .= $this->getAdminPagesList($moduleDirname, $tableName, $tableFieldname, $tableAutoincrement, $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);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/blocks/blocks.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/blocks/blocks.php 2014-07-07 15:24:03 UTC (rev 12686)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/blocks/blocks.php 2014-07-08 19:32:05 UTC (rev 12687)
@@ -101,23 +101,25 @@
{
$fieldName = $fields[$f]->getVar('field_name');
$rp_field_name = $fieldName;
- // Verify if table_fieldname is not empty
- if(!empty($tableFieldname)) {
- if(strpos($fieldName, '_')) {
- $str = strpos($fieldName, '_');
- if($str !== false){
- $rp_field_name = substr($fieldName, $str + 1, strlen($fieldName));
- }
- }
- $tname = $tableFieldname;
- $ret .= <<<EOT
+ if( $fields[$f]->getVar('field_block') == 1 ) {
+ // Verify if table_fieldname is not empty
+ if(!empty($tableFieldname)) {
+ if(strpos($fieldName, '_')) {
+ $str = strpos($fieldName, '_');
+ if($str !== false){
+ $rp_field_name = substr($fieldName, $str + 1, strlen($fieldName));
+ }
+ }
+ $tname = $tableFieldname;
+ $ret .= <<<EOT
\${$tname}['{$rp_field_name}'] = \${$tableName}_arr[\$i]->getVar('{$fieldName}');\n
EOT;
- } else {
- $tname = $tableName;
- $ret .= <<<EOT
+ } else {
+ $tname = $tableName;
+ $ret .= <<<EOT
\${$tname}['{$rp_field_name}'] = \${$tableName}_arr[\$i]->getVar('{$fieldName}');\n
EOT;
+ }
}
}
$ret .= <<<EOT
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/classes/formelements.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/classes/formelements.php 2014-07-07 15:24:03 UTC (rev 12686)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/classes/formelements.php 2014-07-08 19:32:05 UTC (rev 12687)
@@ -223,7 +223,7 @@
// Form Select
\${$fieldName}_select = new XoopsFormSelect({$language}, '{$fieldName}', \$this->getVar('{$fieldName}'));
\${$fieldName}_select->addOption('Empty');
- \${$fieldName}_select->addOptionArray({$tableName}Handler->getList());
+ \${$fieldName}_select->addOptionArray(\${$tableName}Handler->getList());
\$form->addElement( \${$fieldName}_select{$required} );\n
EOT;
return $ret;
@@ -279,6 +279,7 @@
private function getXoopsFormTable($language, $moduleDirname, $tableName, $fields, $required = 'false')
{
$fieldName = '';
+ $ucf_table_name = ucfirst($tableName);
foreach(array_keys($fields) as $f)
{
if(($fields[$f]->getVar('field_parent') == 1)) {
@@ -286,10 +287,10 @@
}
}
$ret = <<<EOT
- // Form Table
+ // Form Topic {$ucf_table_name}
\${$tableName}Handler =& \$this->{$moduleDirname}->getHandler('{$tableName}');
\${$fieldName}_select = new XoopsFormSelect({$language}, '{$fieldName}', \$this->getVar('{$fieldName}'));
- \${$fieldName}_select->addOptionArray(\${$fieldName}Handler->getList());
+ \${$fieldName}_select->addOptionArray(\${$tableName}Handler->getList());
\$form->addElement( \${$fieldName}_select{$required} );\n
EOT;
return $ret;
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/htmlsmartycodes.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/htmlsmartycodes.php 2014-07-07 15:24:03 UTC (rev 12686)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/htmlsmartycodes.php 2014-07-08 19:32:05 UTC (rev 12687)
@@ -121,7 +121,7 @@
return $ret;
}
/*
- * @public function getHtmlTable
+ * @public function getHtmlTableThead
* @param string $class
* @param string $content
*/
@@ -134,7 +134,7 @@
return $ret;
}
/*
- * @public function getHtmlTable
+ * @public function getHtmlTableTbody
* @param string $class
* @param string $content
*/
@@ -197,22 +197,33 @@
/*
* @public function getSmartyConst
* @param string $language
- * @param mixed $field_name
+ * @param mixed $fieldName
*/
- public function getSmartyConst($language, $field_name) {
+ public function getSmartyConst($language, $fieldName) {
$ret = <<<EOT
- <{\$smarty.const.{$language}{$field_name}}>
+ <{\$smarty.const.{$language}{$fieldName}}>
EOT;
return $ret;
}
/*
+ * @public function getSmartyTableFieldNameEmptyData
+ * @param string $tableName
+ * @param string $fieldName
+ */
+ public function getSmartyTableFieldNameEmptyData($tableName = '', $fieldName = '') {
+ $ret = <<<EOT
+ <{\${$tableName}.{$fieldName}}>
+EOT;
+ return $ret;
+ }
+ /*
* @public function getSmartyTableField
- * @param string $table_fieldname
- * @param string $field_name
+ * @param string $tableFieldname
+ * @param string $fieldName
*/
- public function getSmartyTableFieldData($table_fieldname = '', $fieldname = '') {
+ public function getSmartyTableFieldData($tableFieldname = '', $fieldName = '') {
$ret = <<<EOT
- <{\${$table_fieldname}.{$fieldname}}>
+ <{\${$tableFieldname}.{$fieldName}}>
EOT;
return $ret;
}
@@ -220,9 +231,9 @@
* @public function getSmartyIncludeFile
* @param string $name
*/
- public function getSmartyIncludeFile($module_name, $fieldname = 'header') {
+ public function getSmartyIncludeFile($moduleDirname, $tableName = 'header') {
$ret = <<<EOT
- <{include file='db:{$module_name}_{$fieldname}.html'}>
+ <{include file='db:{$moduleDirname}_{$tableName}.html'}>
EOT;
return $ret;
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/admin/pages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/admin/pages.php 2014-07-07 15:24:03 UTC (rev 12686)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/admin/pages.php 2014-07-08 19:32:05 UTC (rev 12687)
@@ -54,11 +54,11 @@
/*
* @private function getTemplatesAdminPagesHeader
* @param string $moduleDirname
- * @param string $table
+ * @param string $tableName
+ * @param string $fields
* @param string $language
*/
- private function getTemplatesAdminPagesHeader($moduleDirname, $table, $language) {
- $tableName = $table->getVar('table_name');
+ private function getTemplatesAdminPagesHeader($moduleDirname, $tableName, $fields, $language) {
$ret = <<<EOT
<{include file="db:{$moduleDirname}_admin_header.tpl"}>
<{if {$tableName}_list}>
@@ -66,12 +66,11 @@
<thead>
<tr class="head">\n
EOT;
- $fields = $this->getTableFields($table->getVar('table_id'));
foreach(array_keys($fields) as $f)
{
$fieldName = $fields[$f]->getVar('field_name');
$lang_fn = $language.strtoupper($fieldName);
- if( ($fields[$f]->getVar('field_inlist') == 1) || ($table->getVar('table_autoincrement') == 1) ) {
+ if( $fields[$f]->getVar('field_inlist') == 1 ) {
$ret .= <<<EOT
<th class="center"><{\$smarty.const.{$lang_fn}}></th>\n
EOT;
@@ -87,19 +86,17 @@
/*
* @private function getTemplatesAdminPagesBody
* @param string $moduleDirname
- * @param string $table
+ * @param string $tableName
+ * @param string $fields
* @param string $language
*/
- private function getTemplatesAdminPagesBody($moduleDirname, $table, $language)
+ private function getTemplatesAdminPagesBody($moduleDirname, $tableName, $fields, $language)
{
- $moduleDirname = strtolower($moduleDirname);
- $tableName = $table->getVar('table_name');
$ret = <<<EOT
<tbody>
<{foreach item=list from=\${$tableName}_list}>
<tr class="<{cycle values='odd, even'}>">\n
EOT;
- $fields = $this->getTableFields($table->getVar('table_id'));
foreach(array_keys($fields) as $f)
{
$fieldName = $fields[$f]->getVar('field_name');
@@ -121,7 +118,7 @@
}
}
$lp_field_name = substr($fieldName, 0, strpos($fieldName, '_'));
- if( ($fields[$f]->getVar('field_inlist') == 1) || ($table->getVar('table_autoincrement') == 1) ) {
+ if( $fields[$f]->getVar('field_inlist') == 1 ) {
switch( $fieldElement ) {
case 8:
$ret .= <<<EOT
@@ -165,18 +162,17 @@
/*
* @private function getTemplatesAdminPagesBodyFieldnameEmpty
* @param string $moduleDirname
- * @param string $table
+ * @param string $tableName
+ * @param string $fields
* @param string $language
*/
- private function getTemplatesAdminPagesBodyFieldnameEmpty($moduleDirname, $table, $language)
+ private function getTemplatesAdminPagesBodyFieldnameEmpty($moduleDirname, $tableName, $fields, $language)
{
- $tableName = $table->getVar('table_name');
$ret = <<<EOT
<tbody>
<{foreach item=list from=\${$tableName}_list}>
<tr class="<{cycle values='odd, even'}>">\n
EOT;
- $fields = $this->getTableFields($table->getVar('table_id'));
foreach(array_keys($fields) as $f)
{
$fieldName = $fields[$f]->getVar('field_name');
@@ -184,7 +180,7 @@
if($f == 0) {
$field_id = $fieldName;
}
- if( ($fields[$f]->getVar('field_inlist') == 1) || ($table->getVar('table_autoincrement') == 1) ) {
+ if( $fields[$f]->getVar('field_inlist') == 1 ) {
switch( $fieldElement ) {
case 8:
$ret .= <<<EOT
@@ -262,13 +258,14 @@
$moduleDirname = $module->getVar('mod_dirname');
$tableName = $table->getVar('table_name');
$tableFieldname = $table->getVar('table_fieldname');
- $language = $this->getLanguage($moduleDirname, 'AM');
- $content = $this->getTemplatesAdminPagesHeader($moduleDirname, $table, $language);
+ $language = $this->getLanguage($moduleDirname, 'AM');
+ $fields = $this->getTableFields($table->getVar('table_id'));
+ $content = $this->getTemplatesAdminPagesHeader($moduleDirname, $tableName, $fields, $language);
// Verify if table_fieldname is not empty
if(!empty($tableFieldname)) {
- $content .= $this->getTemplatesAdminPagesBody($moduleDirname, $table, $language);
+ $content .= $this->getTemplatesAdminPagesBody($moduleDirname, $tableName, $fields, $language);
} else {
- $content .= $this->getTemplatesAdminPagesBodyFieldnameEmpty($moduleDirname, $table, $language);
+ $content .= $this->getTemplatesAdminPagesBodyFieldnameEmpty($moduleDirname, $tableName, $fields, $language);
}
$content .= $this->getTemplatesAdminPagesFooter($moduleDirname);
//
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/user/pages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/user/pages.php 2014-07-07 15:24:03 UTC (rev 12686)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/user/pages.php 2014-07-08 19:32:05 UTC (rev 12687)
@@ -71,9 +71,11 @@
{
$fieldName = $fields[$f]->getVar('field_name');
$lang_stu_field_name = $language.strtoupper($fieldName);
- $ret .= <<<EOT
+ if( $fields[$f]->getVar('field_user') == 1 ) {
+ $ret .= <<<EOT
<th class="center"><{\$smarty.const.{$lang_stu_field_name}}></th>\n
EOT;
+ }
}
$ret .= <<<EOT
</tr>
@@ -107,27 +109,29 @@
$rp_field_name = substr($fieldName, $str + 1, strlen($fieldName));
}
}
- switch( $field_element ) {
- case 8:
- $ret .= <<<EOT
+ if( $fields[$f]->getVar('field_user') == 1 ) {
+ switch( $field_element ) {
+ case 8:
+ $ret .= <<<EOT
<td class="center"><span style="background-color: <{\$list.{$rp_field_name}}>;">\t\t</span></td>\n
EOT;
- break;
- case 9:
- $ret .= <<<EOT
+ break;
+ case 9:
+ $ret .= <<<EOT
<td class="center"><img src="<{xoModuleIcons32}><{\$list.{$rp_field_name}}>" alt="{$tableName}"></td>\n
EOT;
- break;
- case 10:
- $ret .= <<<EOT
+ break;
+ case 10:
+ $ret .= <<<EOT
<td class="center"><img src="<{\${$moduleDirname}_upload_url}>/images/{$tableName}/<{\$list.{$rp_field_name}}>" alt="{$tableName}"></td>\n
EOT;
- break;
- default:
- $ret .= <<<EOT
+ break;
+ default:
+ $ret .= <<<EOT
<td class="center"><{\$list.{$rp_field_name}}></td>\n
EOT;
- break;
+ break;
+ }
}
}
$ret .= <<<EOT
@@ -157,23 +161,25 @@
{
$fieldName = $fields[$f]->getVar('field_name');
$field_element = $fields[$f]->getVar('field_element');
- switch( $field_element ) {
- case 8:
- $ret .= <<<EOT
+ if( $fields[$f]->getVar('field_user') == 1 ) {
+ switch( $field_element ) {
+ case 8:
+ $ret .= <<<EOT
<td class="center"><span style="background-color: <{\$list.{$fieldName}}>;"></span></td>\n
EOT;
- break;
- case 9:
- $ret .= <<<EOT
+ break;
+ case 9:
+ $ret .= <<<EOT
<td class="center"><img src="<{\${$moduleDirname}_upload_url}>/images/{$tableName}/<{\$list.{$fieldName}}>" alt="{$tableName}"></td>\n
EOT;
- break;
- default:
- $ret .= <<<EOT
+ break;
+ default:
+ $ret .= <<<EOT
<td class="center"><{\$list.{$fieldName}}></td>\n
EOT;
- break;
- }
+ break;
+ }
+ }
}
$ret .= <<<EOT
</tr>
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/pages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/pages.php 2014-07-07 15:24:03 UTC (rev 12686)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/pages.php 2014-07-08 19:32:05 UTC (rev 12687)
@@ -92,46 +92,48 @@
{
$fieldName = $fields[$f]->getVar('field_name');
$rp_field_name = $fieldName;
- // Verify if table_fieldname is not empty
- if(!empty($tableFieldname)) {
- if(strpos($fieldName, '_')) {
- $str = strpos($fieldName, '_');
- if($str !== false){
- $rp_field_name = substr($fieldName, $str + 1, strlen($fieldName));
- }
- }
- $lp_field_name = substr($fieldName, 0, strpos($fieldName, '_'));
- $tname = $lp_field_name;
- $fieldElement = $fields[$f]->getVar('field_element');
- if ( $fields[$f]->getVar('field_main') == 1 ) {
- $fpmf = $fieldName; // fpmf = fields parameters main field
- }
- // Verify if this is a textarea or dhtmltextarea
- if ( $fieldElement == 2 || $fieldElement == 3 ) {
- $ret .= <<<EOT
+ if( $fields[$f]->getVar('field_user') == 1 ) {
+ // Verify if table_fieldname is not empty
+ if(!empty($tableFieldname)) {
+ if(strpos($fieldName, '_')) {
+ $str = strpos($fieldName, '_');
+ if($str !== false){
+ $rp_field_name = substr($fieldName, $str + 1, strlen($fieldName));
+ }
+ }
+ $lp_field_name = substr($fieldName, 0, strpos($fieldName, '_'));
+ $tname = $lp_field_name;
+ $fieldElement = $fields[$f]->getVar('field_element');
+ if ( $fields[$f]->getVar('field_main') == 1 ) {
+ $fpmf = $fieldName; // fpmf = fields parameters main field
+ }
+ // Verify if this is a textarea or dhtmltextarea
+ if ( $fieldElement == 2 || $fieldElement == 3 ) {
+ $ret .= <<<EOT
\${$tname}['{$rp_field_name}'] = strip_tags(\${$stl_table_name}_arr[\$i]->getVar('{$fieldName}'));\n
EOT;
- } else {
- $ret .= <<<EOT
+ } else {
+ $ret .= <<<EOT
\${$tname}['{$rp_field_name}'] = \${$stl_table_name}_arr[\$i]->getVar('{$fieldName}');\n
EOT;
- }
- } else {
- $tname = $tableName;
- $fieldElement = $fields[$f]->getVar('field_element');
- if ( $fields[$f]->getVar('field_main') == 1 ) {
- $fpmf = $fieldName; // fpmf = fields parameters main field
- }
- // Verify if this is a textarea or dhtmltextarea
- if ( $fieldElement == 2 || $fieldElement == 3 ) {
- $ret .= <<<EOT
+ }
+ } else {
+ $tname = $tableName;
+ $fieldElement = $fields[$f]->getVar('field_element');
+ if ( $fields[$f]->getVar('field_main') == 1 ) {
+ $fpmf = $fieldName; // fpmf = fields parameters main field
+ }
+ // Verify if this is a textarea or dhtmltextarea
+ if ( $fieldElement == 2 || $fieldElement == 3 ) {
+ $ret .= <<<EOT
\${$tname}['{$rp_field_name}'] = strip_tags(\${$stl_table_name}_arr[\$i]->getVar('{$fieldName}'));\n
EOT;
- } else {
- $ret .= <<<EOT
+ } else {
+ $ret .= <<<EOT
\${$tname}['{$rp_field_name}'] = \${$stl_table_name}_arr[\$i]->getVar('{$fieldName}');\n
EOT;
- }
+ }
+ }
}
...
[truncated message content] |
|
From: <txm...@us...> - 2014-07-09 18:25:22
|
Revision: 12692
http://sourceforge.net/p/xoops/svn/12692
Author: txmodxoops
Date: 2014-07-09 18:25:13 +0000 (Wed, 09 Jul 2014)
Log Message:
-----------
- Updated
- Still work to do
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/objects.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/docs/changelog.txt
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/xoops_version.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/pages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/pages.php 2014-07-09 13:47:01 UTC (rev 12691)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/pages.php 2014-07-09 18:25:13 UTC (rev 12692)
@@ -16,7 +16,7 @@
* @package tdmcreate
* @since 2.5.0
* @author Txmod Xoops http://www.txmodxoops.org
- * @version $Id: admin_pages.php 12258 2014-01-02 09:33:29Z timgno $
+ * @version $Id: pages.php 12258 2014-01-02 09:33:29Z timgno $
*/
defined('XOOPS_ROOT_PATH') or die('Restricted access');
require_once 'objects.php';
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/objects.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/objects.php 2014-07-09 13:47:01 UTC (rev 12691)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/objects.php 2014-07-09 18:25:13 UTC (rev 12692)
@@ -35,11 +35,11 @@
return $instance;
}
/*
- * @public function getPhpUserHeader
+ * @public function getUserHeader
* @param string $moduleDirname
* @param string $tableName
*/
- public function getPhpUserHeader($moduleDirname, $tableName) {
+ public function getUserHeader($moduleDirname, $tableName) {
$ret = <<<EOT
include_once 'header.php';
\$GLOBALS['xoopsOption']['template_main'] = '{$moduleDirname}_{$tableName}.tpl';
@@ -48,10 +48,10 @@
return $ret;
}
/*
- * @public function getPhpUserIndex
+ * @public function getUserIndex
* @param string $moduleDirname
*/
- public function getPhpUserIndex($moduleDirname) {
+ public function getUserIndex($moduleDirname) {
$ret = <<<EOT
include_once 'header.php';
\$GLOBALS['xoopsOption']['template_main'] = '{$moduleDirname}_index.tpl';
@@ -60,13 +60,69 @@
return $ret;
}
/*
- * @public function getPhpUserFooter
+ * @public function getUserFooter
* @param null
*/
- public function getPhpUserFooter() {
+ public function getUserFooter() {
$ret = <<<EOT
include_once 'footer.php';
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// Get Var {$fieldName}
+\t\t\t\${$lpFieldName}['{$rpFieldName}'] = \${$tableName}_arr[\$i]->getVar('{$fieldName}');\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// Get Var {$fieldName}
+\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// Get Var {$fieldName}
+\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// Get Var {$fieldName}
+\t\t\t\${$lpFieldName}['{$rpFieldName}'] = formatTimeStamp(\${$tableName}_arr[\$i]->getVar('{$fieldName}'), 's');\n
+EOT;
+ return $ret;
+ }
}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/pages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/pages.php 2014-07-09 13:47:01 UTC (rev 12691)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/pages.php 2014-07-09 18:25:13 UTC (rev 12692)
@@ -16,19 +16,24 @@
* @package tdmcreate
* @since 2.5.0
* @author Txmod Xoops http://www.txmodxoops.org
- * @version $Id: user_pages.php 12258 2014-01-02 09:33:29Z timgno $
+ * @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 UserPages extends TDMCreateFile
{
/*
+ * @var string
+ */
+ private $userobjects = null;
+ /*
* @public function constructor
* @param null
*/
public function __construct() {
parent::__construct();
- $this->tdmcfile = TDMCreateFile::getInstance();
+ $this->tdmcfile = TDMCreateFile::getInstance();
+ $this->userobjects = UserObjects::getInstance();
}
/*
* @static function &getInstance
@@ -62,9 +67,10 @@
$table = $this->getTable();
$tableName = $table->getVar('table_name');
$tableFieldname = $table->getVar('table_fieldname');
- $stu_mod_name = strtoupper($moduleDirname);
- $stu_table_name = strtoupper($tableName);
- $stl_table_name = strtolower($tableName);
+ $tableAutoincrement = $table->getVar('table_autoincrement');
+ $stuModuleDirname = strtoupper($moduleDirname);
+ $stuTableName = strtoupper($tableName);
+ $stlTableName = strtolower($tableName);
$ret = <<<EOT
\ninclude_once 'header.php';
\$GLOBALS['xoopsOption']['template_main'] = '{$moduleDirname}_{$tableName}.tpl';
@@ -74,16 +80,16 @@
// Define Stylesheet
\$xoTheme->addStylesheet( \$style );
// Get Handler
-\${$stl_table_name}Handler =& \${$moduleDirname}->getHandler('{$stl_table_name}');
+\${$stlTableName}Handler =& \${$moduleDirname}->getHandler('{$stlTableName}');
//
-\$GLOBALS['xoopsTpl']->assign('{$moduleDirname}_upload_url', {$stu_mod_name}_UPLOAD_URL);
+\$GLOBALS['xoopsTpl']->assign('{$moduleDirname}_upload_url', {$stuModuleDirname}_UPLOAD_URL);
//
\$criteria = new CriteriaCompo();
-\${$stl_table_name}_count = \${$stl_table_name}Handler->getCount(\$criteria);
-\${$stl_table_name}_arr = \${$stl_table_name}Handler->getAll(\$criteria);
+\${$stlTableName}_count = \${$stlTableName}Handler->getCount(\$criteria);
+\${$stlTableName}_arr = \${$stlTableName}Handler->getAll(\$criteria);
\$keywords = array();
-if (\${$stl_table_name}_count > 0) {
- foreach (array_keys(\${$stl_table_name}_arr) as \$i)
+if (\${$stlTableName}_count > 0) {
+ foreach (array_keys(\${$stlTableName}_arr) as \$i)
{\n
EOT;
// Fields
@@ -92,59 +98,45 @@
{
$fieldName = $fields[$f]->getVar('field_name');
$rp_field_name = $fieldName;
- if( $fields[$f]->getVar('field_user') == 1 ) {
- // Verify if table_fieldname is not empty
- if(!empty($tableFieldname)) {
- if(strpos($fieldName, '_')) {
- $str = strpos($fieldName, '_');
- if($str !== false){
- $rp_field_name = substr($fieldName, $str + 1, strlen($fieldName));
- }
- }
- $lp_field_name = substr($fieldName, 0, strpos($fieldName, '_'));
- $tname = $lp_field_name;
- $fieldElement = $fields[$f]->getVar('field_element');
- if ( $fields[$f]->getVar('field_main') == 1 ) {
- $fpmf = $fieldName; // fpmf = fields parameters main field
- }
- // Verify if this is a textarea or dhtmltextarea
- if ( $fieldElement == 2 || $fieldElement == 3 ) {
- $ret .= <<<EOT
- \${$tname}['{$rp_field_name}'] = strip_tags(\${$stl_table_name}_arr[\$i]->getVar('{$fieldName}'));\n
-EOT;
- } else {
- $ret .= <<<EOT
- \${$tname}['{$rp_field_name}'] = \${$stl_table_name}_arr[\$i]->getVar('{$fieldName}');\n
-EOT;
- }
- } else {
- $tname = $tableName;
- $fieldElement = $fields[$f]->getVar('field_element');
- if ( $fields[$f]->getVar('field_main') == 1 ) {
- $fpmf = $fieldName; // fpmf = fields parameters main field
- }
- // Verify if this is a textarea or dhtmltextarea
- if ( $fieldElement == 2 || $fieldElement == 3 ) {
- $ret .= <<<EOT
- \${$tname}['{$rp_field_name}'] = strip_tags(\${$stl_table_name}_arr[\$i]->getVar('{$fieldName}'));\n
-EOT;
- } else {
- $ret .= <<<EOT
- \${$tname}['{$rp_field_name}'] = \${$stl_table_name}_arr[\$i]->getVar('{$fieldName}');\n
-EOT;
- }
- }
+ // Verify if table_fieldname is not empty
+ $lpFieldName = !empty($tableFieldname) ? substr($fieldName, 0, strpos($fieldName, '_')) : $tableName;
+ if(strpos($fieldName, '_')) {
+ $str = strpos($fieldName, '_');
+ if($str !== false){
+ $rpFieldName = substr($fieldName, $str + 1, strlen($fieldName));
+ }
+ }
+ if ( $fields[$f]->getVar('field_main') == 1 ) {
+ $fpmf = $fieldName; // fpmf = fields parameters main field
}
+ $fieldElement = $fields[$f]->getVar('field_element');
+ if( ($fields[$f]->getVar('field_user') == 1) || ($tableAutoincrement == 1) ) {
+ switch($fieldElement) {
+ case 2:
+ case 3:
+ $ret .= $this->userobjects->getTextAreaGetVar($lpFieldName, $rpFieldName, $tableName, $fieldName);
+ break;
+ case 7:
+ $ret .= $this->userobjects->getSelectUserGetVar($lpFieldName, $rpFieldName, $tableName, $fieldName);
+ break;
+ case 12:
+ $ret .= $this->userobjects->getTextDateSelectGetVar($lpFieldName, $rpFieldName, $tableName, $fieldName);
+ break;
+ default:
+ $ret .= $this->userobjects->getSimpleGetVar($lpFieldName, $rpFieldName, $tableName, $fieldName);
+ break;
+ }
+ }
}
$ret .= <<<EOT
- \$GLOBALS['xoopsTpl']->append('{$stl_table_name}', \${$tname});
- \$keywords[] = \${$stl_table_name}_arr[\$i]->getVar('{$fpmf}');
- unset(\${$tname});
+ \$GLOBALS['xoopsTpl']->append('{$stlTableName}', \${$lpFieldName});
+ \$keywords[] = \${$stlTableName}_arr[\$i]->getVar('{$fpmf}');
+ unset(\${$lpFieldName});
}
// Display Navigation
- if (\${$stl_table_name}_count > \$limit) {
+ if (\${$stlTableName}_count > \$limit) {
include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
- \$nav = new XoopsPageNav(\${$stl_table_name}_count, \$limit, \$start, 'start');
+ \$nav = new XoopsPageNav(\${$stlTableName}_count, \$limit, \$start, 'start');
\$GLOBALS['xoopsTpl']->assign('pagenav', \$nav->renderNav(4));
}
}
@@ -152,9 +144,9 @@
{$moduleDirname}_meta_keywords(\${$moduleDirname}->getConfig('keywords').', '. implode(', ', \$keywords));
unset(\$keywords);
// description
-{$moduleDirname}_meta_description({$language}{$stu_table_name}_DESC);
+{$moduleDirname}_meta_description({$language}{$stuTableName}_DESC);
//
-\$GLOBALS['xoopsTpl']->assign('xoops_mpageurl', {$stu_mod_name}_URL.'/{$stl_table_name}.php');
+\$GLOBALS['xoopsTpl']->assign('xoops_mpageurl', {$stuModuleDirname}_URL.'/{$stlTableName}.php');
//
include_once 'footer.php';
EOT;
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/docs/changelog.txt
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/docs/changelog.txt 2014-07-09 13:47:01 UTC (rev 12691)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/docs/changelog.txt 2014-07-09 18:25:13 UTC (rev 12692)
@@ -2,7 +2,11 @@
2014/01/02: Version 1.91 alpha 1
=================================
-- Under Construction
+- Refactoring
+- Rewritten from scratch
+- Added templates admin
+- Added fields table
+- Added more parameters in fields form
=================================
2013/05/12: Version 1.39 RC 1
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/xoops_version.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/xoops_version.php 2014-07-09 13:47:01 UTC (rev 12691)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/xoops_version.php 2014-07-09 18:25:13 UTC (rev 12692)
@@ -24,12 +24,12 @@
$modversion['name'] = "{$dirname}";
$modversion['version'] = 1.91;
$modversion['description'] = _MI_TDMCREATE_DESC;
-$modversion['author'] = 'Xoops TDM';
+$modversion['author'] = "Xoops TDM";
$modversion['author_website_url'] = "http://www.xoops.org/";
$modversion['author_website_name'] = "Xoops Team Developers Module";
$modversion['credits'] = "Mamba(Xoops), Timgno(Txmod Xoops)";
-$modversion['help'] = 'page=help';
-$modversion['license'] = 'GNU GPL 2.0 or later';
+$modversion['help'] = "page=help";
+$modversion['license'] = "GNU GPL 2.0 or later";
$modversion['license_url'] = "www.gnu.org/licenses/gpl-2.0.html/";
$modversion['release_info'] = "README";
$modversion['release_file'] = XOOPS_URL."/modules/{$dirname}/docs/readme.txt";
@@ -38,16 +38,16 @@
$modversion['image'] = "assets/images/logo.png";
$modversion['dirname'] = "{$dirname}";
-$modversion['dirmoduleadmin'] = '/Frameworks/moduleclasses/moduleadmin';
-$modversion['sysicons16'] = '../../Frameworks/moduleclasses/icons/16';
-$modversion['sysicons32'] = '../../Frameworks/moduleclasses/icons/32';
+$modversion['dirmoduleadmin'] = "/Frameworks/moduleclasses/moduleadmin";
+$modversion['sysicons16'] = "../../Frameworks/moduleclasses/icons/16";
+$modversion['sysicons32'] = "../../Frameworks/moduleclasses/icons/32";
// Local icons
-$modversion['modicons16'] = XOOPS_URL . '/modules/'.$dirname.'/assets/images/icons/16';
-$modversion['modicons32'] = XOOPS_URL . '/modules/'.$dirname.'/assets/images/icons/32';
+$modversion['modicons16'] = XOOPS_URL . "/modules/{$dirname}/assets/images/icons/16";
+$modversion['modicons32'] = XOOPS_URL . "/modules/{$dirname}/assets/images/icons/32";
$modversion['targetdir'] = XOOPS_ROOT_PATH . "/modules/{$dirname}/modules/";
-$modversion['release_date'] = '2014/02/07';
+$modversion['release_date'] = "2014/02/07";
$modversion['module_website_url'] = "http://www.xoops.org/";
$modversion['module_website_name'] = "XOOPS";
$modversion['module_status'] = "Alpha 1";
@@ -59,8 +59,8 @@
//about
$modversion['demo_site_url'] = "http://www.xoops.org/";
$modversion['demo_site_name'] = "Xoops TDM";
-$modversion['forum_site_url'] = "http://xoops.org/modules/newbb/viewtopic.php?post_id=352671";
-$modversion['forum_site_name'] = "TDMCreate - testers needed";
+$modversion['forum_site_url'] = "http://xoops.org/modules/newbb/viewtopic.php?post_id=358118";
+$modversion['forum_site_name'] = "TDMCreate 1.91 alpha 1 for Testing";
$modversion['module_website_name'] = "Xoops TDM";
// Admin things
$modversion['system_menu'] = 1;
|
|
From: <txm...@us...> - 2014-07-10 18:14:22
|
Revision: 12693
http://sourceforge.net/p/xoops/svn/12693
Author: txmodxoops
Date: 2014-07-10 18:14:17 +0000 (Thu, 10 Jul 2014)
Log Message:
-----------
- Fixed bugs
- Updated
- Still work to do
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/menu.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/architecture.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/xoops_version.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/menu.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/menu.php 2014-07-09 18:25:13 UTC (rev 12692)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/menu.php 2014-07-10 18:14:17 UTC (rev 12693)
@@ -130,7 +130,7 @@
$content .= <<<EOT
\$adminmenu[\$i]['title'] = {$language}{$menu};
\$adminmenu[\$i]['link'] = 'admin/{$tables[$t]->getVar('table_name')}.php';
-\$adminmenu[\$i]['icon'] = \$sysPathIcon32.'/{$tables[$t]->getVar('table_image')}';\n
+\$adminmenu[\$i]['icon'] = 'assets/images/icons/32/{$tables[$t]->getVar('table_image')}';\n
EOT;
//$content .= $this->getAdminMenuImagesPath($tables, $t);
$content .= <<<EOT
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/architecture.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/architecture.php 2014-07-09 18:25:13 UTC (rev 12692)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/architecture.php 2014-07-10 18:14:17 UTC (rev 12693)
@@ -106,7 +106,7 @@
$stlModuleAuthor = str_replace(' ', '', strtolower($module->getVar('mod_author')));
// Creation of the Directory in repository
$targetDirectory = $this->uploadPath.'/repository/'. $stlModuleDirname;
- $uploadImagesFolder = $this->uploadPath.'/images/repository';
+ $uploadImagesRepository = $this->uploadPath.'/images/repository';
// Creation of "module" folder
$this->structure->getPath($targetDirectory);
// Creation of "module" folder
@@ -133,7 +133,7 @@
$this->structure->makeDirAndCopyFile('assets/images', $indexFile, 'index.html');
//Copy the logo of the module
$modImage = str_replace(' ', '', strtolower($module->getVar('mod_image')));
- $this->structure->copyFile('assets/images', $uploadImagesFolder.'/'.$modImage, $modImage);
+ $this->structure->copyFile('assets/images', $uploadImagesRepository.'/'.$modImage, $modImage);
// Creation of 'images/icons' folder and index.html file - Added in Version 1.15
$this->structure->makeDirAndCopyFile('assets/images/icons', $indexFile, 'index.html');
// Creation of "images/icons/16" folder and index.html file
@@ -141,7 +141,7 @@
// Creation of "images/icons/32" folder and index.html file
$this->structure->makeDirAndCopyFile('assets/images/icons/32', $indexFile, 'index.html');
// Copy of 'module_author_logo.gif' file in uploads dir
- $logoGifFrom = $uploadImagesFolder.'/'.$stlModuleAuthor.'_logo.gif';
+ $logoGifFrom = $uploadImagesRepository.'/'.$stlModuleAuthor.'_logo.gif';
if (!file_exists($logoGifFrom)) {
copy($logosFolder.'/'.$stlModuleAuthor.'_logo.gif', $logoGifFrom);
}
@@ -203,6 +203,7 @@
$modId = $module->getVar('mod_id');
$moduleDirname = $module->getVar('mod_dirname');
$uploadTablesIcons32 = $this->uploadPath.'/images/tables';
+ $framePathIcon32 = XOOPS_ROOT_PATH . '/Frameworks/moduleclasses/icons/32';
// Id of tables
$criteriaTables = new CriteriaCompo();
$criteriaTables->add(new Criteria('table_mid', $modId));
@@ -227,9 +228,11 @@
// Get Table Object
$table = $this->tdmcreate->getHandler('tables')->get($tableId);
// Copy of tables images file
- if( file_exists($uploadTableImage = $uploadTablesIcons32.'/'.$tableImage)) {
+ if( file_exists($uploadTableImage = $uploadTablesIcons32.'/'.$tableImage )) {
$this->structure->copyFile('assets/images/icons/32', $uploadTableImage, $tableImage);
- }
+ } elseif( file_exists($uploadTableImage = $framePathIcon32.'/'.$tableImage )) {
+ $this->structure->copyFile('assets/images/icons/32', $uploadTableImage, $tableImage);
+ }
// Creation of admin files
if ( $tableAdmin == 1) {
// Admin Pages File
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/xoops_version.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/xoops_version.php 2014-07-09 18:25:13 UTC (rev 12692)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/xoops_version.php 2014-07-10 18:14:17 UTC (rev 12693)
@@ -21,7 +21,7 @@
if (!defined('XOOPS_ROOT_PATH')){ exit(); }
$dirname = basename( dirname( __FILE__ ) ) ;
-$modversion['name'] = "{$dirname}";
+$modversion['name'] = _MI_TDMCREATE_NAME;
$modversion['version'] = 1.91;
$modversion['description'] = _MI_TDMCREATE_DESC;
$modversion['author'] = "Xoops TDM";
|
|
From: <txm...@us...> - 2014-07-10 19:07:36
|
Revision: 12697
http://sourceforge.net/p/xoops/svn/12697
Author: txmodxoops
Date: 2014-07-10 19:07:25 +0000 (Thu, 10 Jul 2014)
Log Message:
-----------
After renamed main folder, updated revision
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/menu.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/objects.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/architecture.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/blocks/blocks.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/classes/classes.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/classes/formelements.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/htmlsmartycodes.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/admin/pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/user/pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/objects.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/xoopsversion.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/docs/changelog.txt
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/language/english/admin.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/xoops_version.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/fields.php 2014-07-10 18:47:00 UTC (rev 12696)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/fields.php 2014-07-10 19:07:25 UTC (rev 12697)
@@ -158,7 +158,7 @@
if ( !$GLOBALS['xoopsSecurity']->check() ) {
redirect_header('fields.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
}
- $field_id = XoopsRequest::getInt('field_id');
+ $fieldId = XoopsRequest::getInt('field_id');
// Fields Handler
$fields = $tdmcreate->getHandler('fields');
// Set Variables
@@ -213,9 +213,9 @@
if (!$tdmcreate->getHandler('fieldelements')->insert($fieldelementObj) ) {
$GLOBALS['xoopsTpl']->assign('error', $fieldelementObj->getHtmlErrors() . ' Field element');
}
- redirect_header('fields.php', 2, sprintf(_AM_TDMCREATE_FIELD_FORM_SAVED_OK, $table_name));
+ redirect_header('fields.php', 2, sprintf(_AM_TDMCREATE_FIELDS_FORM_SAVED_OK, $table_name));
} else {
- redirect_header('fields.php', 2, sprintf(_AM_TDMCREATE_FIELD_FORM_UPDATED_OK, $table_name));
+ redirect_header('fields.php', 2, sprintf(_AM_TDMCREATE_FIELDS_FORM_UPDATED_OK, $table_name));
}
//
$GLOBALS['xoopsTpl']->assign('error', $fieldsObj->getHtmlErrors());
@@ -232,8 +232,8 @@
$adminMenu->addItemButton(_AM_TDMCREATE_FIELDS_LIST, 'fields.php', 'list');
$GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
// Form Edit
- $field_id = XoopsRequest::getInt('field_id');
- $fieldsObj = $tdmcreate->getHandler('fields')->get( $field_id );
+ $fieldId = XoopsRequest::getInt('field_id');
+ $fieldsObj = $tdmcreate->getHandler('fields')->get( $fieldId );
$form = $fieldsObj->getFormEdit($field_mid, $fieldTid);
$GLOBALS['xoopsTpl']->assign('form', $form->render());
// Test -> Will be removed
@@ -242,9 +242,9 @@
case 'drag':
$side = TDMCreate_CleanVars( $_POST, 'field_id', 0, 'int' );
- $field_id = XoopsRequest::getInt('field_id');
- if ( $field_id > 0 ) {
- $fieldsObj = $tdmcreate->getHandler('fields')->get( $field_id );
+ $fieldId = XoopsRequest::getInt('field_id');
+ if ( $fieldId > 0 ) {
+ $fieldsObj = $tdmcreate->getHandler('fields')->get( $fieldId );
$fieldsObj->setVar('field_id', $side);
if (!$tdmcreate->getHandler('fields')->insert( $fieldsObj )) {
redirect_header('fields.php', 5, _AM_TDMCREATE_FIELD_SIDE_ERROR);
@@ -271,11 +271,12 @@
break;
case 'display':
+ $fieldId = XoopsRequest::getInt('field_id');
// Get the list of fields
$criteria = new CriteriaCompo();
$criteria->add(new Criteria('field_tid', $fieldTid));
$fields = $tdmcreate->getHandler('fields')->getObjects($criteria);
- $fieldsObj =& $tdmcreate->getHandler('fields')->get($field_id);
+ $fieldsObj =& $tdmcreate->getHandler('fields')->get($fieldId);
if (isset($_GET['field_tid'])) {
if (isset($_GET['field_parent'])) {
foreach ($fields as $field) {
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/menu.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/menu.php 2014-07-10 18:47:00 UTC (rev 12696)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/menu.php 2014-07-10 19:07:25 UTC (rev 12697)
@@ -130,7 +130,7 @@
$content .= <<<EOT
\$adminmenu[\$i]['title'] = {$language}{$menu};
\$adminmenu[\$i]['link'] = 'admin/{$tables[$t]->getVar('table_name')}.php';
-\$adminmenu[\$i]['icon'] = \$sysPathIcon32.'/{$tables[$t]->getVar('table_image')}';\n
+\$adminmenu[\$i]['icon'] = 'assets/images/icons/32/{$tables[$t]->getVar('table_image')}';\n
EOT;
//$content .= $this->getAdminMenuImagesPath($tables, $t);
$content .= <<<EOT
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/objects.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/objects.php 2014-07-10 18:47:00 UTC (rev 12696)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/objects.php 2014-07-10 19:07:25 UTC (rev 12697)
@@ -47,11 +47,11 @@
return $ret;
}
/*
- * @public function getTextDateSelect
+ * @public function getTextDateSelectSetVar
* @param string $tableName
* @param string $fieldName
*/
- public function getTextDateSelect($tableName, $fieldName) {
+ public function getTextDateSelectSetVar($tableName, $fieldName) {
$ret = <<<EOT
// Set Var {$fieldName}
\${$tableName}Obj->setVar('{$fieldName}', strtotime(\$_POST['{$fieldName}']));\n
@@ -59,11 +59,11 @@
return $ret;
}
/*
- * @public function getCheckBoxOrRadioYN
+ * @public function getCheckBoxOrRadioYNSetVar
* @param string $tableName
* @param string $fieldName
*/
- public function getCheckBoxOrRadioYN($tableName, $fieldName) {
+ public function getCheckBoxOrRadioYNSetVar($tableName, $fieldName) {
$ret = <<<EOT
// Set Var {$fieldName}
\${$tableName}Obj->setVar('{$fieldName}', ((\$_REQUEST['{$fieldName}'] == 1) ? '1' : '0'));\n
@@ -71,12 +71,12 @@
return $ret;
}
/*
- * @public function getImageList
+ * @public function getImageListSetVar
* @param string $moduleDirname
* @param string $tableName
* @param string $fieldName
*/
- public function getImageList($moduleDirname, $tableName, $fieldName) {
+ public function getImageListSetVar($moduleDirname, $tableName, $fieldName) {
$ret = <<<EOT
// Set Var {$fieldName}
include_once XOOPS_ROOT_PATH.'/class/uploader.php';
@@ -99,12 +99,12 @@
return $ret;
}
/*
- * @public function getUploadImage
+ * @public function getUploadImageSetVar
* @param string $moduleDirname
* @param string $tableName
* @param string $fieldName
*/
- public function getUploadImage($moduleDirname, $tableName, $fieldName) {
+ public function getUploadImageSetVar($moduleDirname, $tableName, $fieldName) {
$stuModuleDirname = strtoupper($moduleDirname);
$ret = <<<EOT
// Set Var {$fieldName}
@@ -128,12 +128,12 @@
return $ret;
}
/*
- * @public function getUploadFile
+ * @public function getUploadFileSetVar
* @param string $moduleDirname
* @param string $tableName
* @param string $fieldName
*/
- public function getUploadFile($moduleDirname, $tableName, $fieldName) {
+ public function getUploadFileSetVar($moduleDirname, $tableName, $fieldName) {
$stuModuleDirname = strtoupper($moduleDirname);
$ret = <<<EOT
// Set Var {$fieldName}
@@ -153,5 +153,61 @@
}\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 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
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/pages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/pages.php 2014-07-10 18:47:00 UTC (rev 12696)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/pages.php 2014-07-10 19:07:25 UTC (rev 12697)
@@ -16,7 +16,7 @@
* @package tdmcreate
* @since 2.5.0
* @author Txmod Xoops http://www.txmodxoops.org
- * @version $Id: admin_pages.php 12258 2014-01-02 09:33:29Z timgno $
+ * @version $Id: pages.php 12258 2014-01-02 09:33:29Z timgno $
*/
defined('XOOPS_ROOT_PATH') or die('Restricted access');
require_once 'objects.php';
@@ -61,12 +61,14 @@
* @param string $moduleDirname
* @param string $tableName
*/
- public function getAdminPagesHeader($moduleDirname, $tableName) {
+ public function getAdminPagesHeader($moduleDirname, $tableName, $fpif) {
$ret = <<<EOT
include_once 'header.php';
//It recovered the value of argument op in URL$
-\$op = {$moduleDirname}_CleanVars(\$_REQUEST, 'op', 'list', 'string');
+\$op = XoopsRequest::getString('op', 'list');
+// Request {$fpif}
+\${$fpif} = XoopsRequest::getInt('{$fpif}');
// Switch options
switch (\$op)
{\n
@@ -84,18 +86,18 @@
* @param string $fpif
* @param string $fpmf
*/
- public function getAdminPagesList($moduleDirname, $tableName, $tableFieldname, $language, $fields, $fpif, $fpmf) {
- $stu_module_dirname = strtoupper($moduleDirname);
- $stu_table_name = strtoupper($tableName);
- $stu_table_fieldname = strtoupper($tableFieldname);
+ public function getAdminPagesList($moduleDirname, $tableName, $tableFieldname, $tableAutoincrement, $language, $fields, $fpif, $fpmf) {
+ $stuModuleDirname = strtoupper($moduleDirname);
+ $stuTableName = strtoupper($tableName);
+ $stuTableFieldname = strtoupper($tableFieldname);
$ret = <<<EOT
case 'list':
default:
- \$limit = \${$moduleDirname}->getConfig('adminpager');
- \$start = {$moduleDirname}_CleanVars(\$_REQUEST, 'start', 0);
+ \$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_{$stu_table_fieldname}, '{$tableName}.php?op=new', 'add');
+ \$adminMenu->addItemButton({$language}ADD_{$stuTableFieldname}, '{$tableName}.php?op=new', 'add');
\$GLOBALS['xoopsTpl']->assign('buttons', \$adminMenu->renderButton());
\$criteria = new CriteriaCompo();
\$criteria->setSort('{$fpif} ASC, {$fpmf}');
@@ -103,8 +105,8 @@
\${$tableName}_rows = \${$tableName}Handler->getCount(\$criteria);
\${$tableName}_arr = \${$tableName}Handler->getAll(\$criteria);
unset(\$criteria);
- \$GLOBALS['xoopsTpl']->assign('{$moduleDirname}_url', {$stu_module_dirname}_URL);
- \$GLOBALS['xoopsTpl']->assign('{$moduleDirname}_upload_url', {$stu_module_dirname}_UPLOAD_URL);
+ \$GLOBALS['xoopsTpl']->assign('{$moduleDirname}_url', {$stuModuleDirname}_URL);
+ \$GLOBALS['xoopsTpl']->assign('{$moduleDirname}_upload_url', {$stuModuleDirname}_UPLOAD_URL);
// Table view
if (\${$tableName}_rows > 0)
{
@@ -114,29 +116,37 @@
foreach(array_keys($fields) as $f)
{
$fieldName = $fields[$f]->getVar('field_name');
- $rp_field_name = $fieldName;
+ $rpFieldName = $fieldName;
// Verify if table_fieldname is not empty
- if(!empty($tableFieldname)) {
- if(strpos($fieldName, '_')) {
- $str = strpos($fieldName, '_');
- if($str !== false){
- $rp_field_name = substr($fieldName, $str + 1, strlen($fieldName));
- }
- }
- $lp_field_name = substr($fieldName, 0, strpos($fieldName, '_'));
- $ret .= <<<EOT
- \${$lp_field_name}['{$rp_field_name}'] = \${$tableName}_arr[\$i]->getVar('{$fieldName}');\n
-EOT;
- } else {
- $lp_field_name = $tableName;
- $ret .= <<<EOT
- \${$lp_field_name}['{$rp_field_name}'] = \${$tableName}_arr[\$i]->getVar('{$fieldName}');\n
-EOT;
+ $lpFieldName = !empty($tableFieldname) ? substr($fieldName, 0, strpos($fieldName, '_')) : $tableName;
+ if(strpos($fieldName, '_')) {
+ $str = strpos($fieldName, '_');
+ if($str !== false){
+ $rpFieldName = substr($fieldName, $str + 1, strlen($fieldName));
+ }
+ }
+ $fieldElement = $fields[$f]->getVar('field_element');
+ if( ($fields[$f]->getVar('field_admin') == 1) || ($tableAutoincrement == 1) ) {
+ switch($fieldElement) {
+ case 2:
+ case 3:
+ $ret .= $this->adminobjects->getTextAreaGetVar($lpFieldName, $rpFieldName, $tableName, $fieldName);
+ break;
+ case 7:
+ $ret .= $this->adminobjects->getSelectUserGetVar($lpFieldName, $rpFieldName, $tableName, $fieldName);
+ break;
+ case 12:
+ $ret .= $this->adminobjects->getTextDateSelectGetVar($lpFieldName, $rpFieldName, $tableName, $fieldName);
+ break;
+ default:
+ $ret .= $this->adminobjects->getSimpleGetVar($lpFieldName, $rpFieldName, $tableName, $fieldName);
+ break;
+ }
}
}
$ret .= <<<EOT
- \$GLOBALS['xoopsTpl']->append('{$tableName}_list', \${$lp_field_name});
- unset(\${$lp_field_name});
+ \$GLOBALS['xoopsTpl']->append('{$tableName}_list', \${$lpFieldName});
+ unset(\${$lpFieldName});
}\n
EOT;
$ret .= <<<EOT
@@ -146,7 +156,7 @@
\$GLOBALS['xoopsTpl']->assign('pagenav', \$pagenav->renderNav(4));
}
} else {
- \$GLOBALS['xoopsTpl']->assign('error', {$language}THEREARENT_{$stu_table_name});
+ \$GLOBALS['xoopsTpl']->assign('error', {$language}THEREARENT_{$stuTableName});
}
break;\n
EOT;
@@ -160,11 +170,11 @@
* @param string $language
*/
public function getAdminPagesNew($moduleDirname, $tableName, $language) {
- $stu_table_name = strtoupper($tableName);
+ $stuTableName = strtoupper($tableName);
$ret = <<<EOT
case 'new':
\$template_main = '{$moduleDirname}_admin_{$tableName}.tpl';
- \$adminMenu->addItemButton({$language}{$stu_table_name}_LIST, '{$tableName}.php', 'list');
+ \$adminMenu->addItemButton({$language}{$stuTableName}_LIST, '{$tableName}.php', 'list');
\$GLOBALS['xoopsTpl']->assign('navigation', \$adminMenu->addNavigation('{$tableName}.php'));
\$GLOBALS['xoopsTpl']->assign('buttons', \$adminMenu->renderButton());
// Get Form
@@ -192,8 +202,8 @@
if ( !\$GLOBALS['xoopsSecurity']->check() ) {
redirect_header('{$tableName}.php', 3, implode(',', \$GLOBALS['xoopsSecurity']->getErrors()));
}
- if (isset(\$_REQUEST['{$fpif}'])) {
- \${$tableName}Obj =& \${$tableName}Handler->get(\$_REQUEST['{$fpif}']);
+ if (isset(\${$fpif})) {
+ \${$tableName}Obj =& \${$tableName}Handler->get(\${$fpif});
} else {
\${$tableName}Obj =& \${$tableName}Handler->create();
}
@@ -207,19 +217,19 @@
switch($fieldElement) {
case 4:
case 5:
- $ret .= $this->adminobjects->getCheckBoxOrRadioYN($tableName, $fieldName);
+ $ret .= $this->adminobjects->getCheckBoxOrRadioYNSetVar($tableName, $fieldName);
break;
case 9:
- $ret .= $this->adminobjects->getImageList($moduleDirname, $tableName, $fieldName);
+ $ret .= $this->adminobjects->getImageListSetVar($moduleDirname, $tableName, $fieldName);
break;
case 10:
- $ret .= $this->adminobjects->getUploadImage($moduleDirname, $tableName, $fieldName);
+ $ret .= $this->adminobjects->getUploadImageSetVar($moduleDirname, $tableName, $fieldName);
break;
case 11:
- $ret .= $this->adminobjects->getUploadFile($moduleDirname, $tableName, $fieldName);
+ $ret .= $this->adminobjects->getUploadFileSetVar($moduleDirname, $tableName, $fieldName);
break;
case 12:
- $ret .= $this->adminobjects->getTextDateSelect($tableName, $fieldName);
+ $ret .= $this->adminobjects->getTextDateSelectSetVar($tableName, $fieldName);
break;
default:
$ret .= $this->adminobjects->getSimpleSetVar($tableName, $fieldName);
@@ -251,17 +261,17 @@
* @param string $fpif
*/
public function getAdminPagesEdit($moduleDirname, $tableName, $tableFieldname, $language, $fpif) {
- $stu_table_name = strtoupper($tableName);
- $stu_table_fieldname = strtoupper($tableFieldname);
+ $stuTableName = strtoupper($tableName);
+ $stuTableFieldname = strtoupper($tableFieldname);
$ret = <<<EOT
case 'edit':
\$template_main = '{$moduleDirname}_admin_{$tableName}.tpl';
- \$adminMenu->addItemButton({$language}ADD_{$stu_table_fieldname}, '{$tableName}.php?op=new', 'add');
- \$adminMenu->addItemButton({$language}{$stu_table_name}_LIST, '{$tableName}.php', 'list');
+ \$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(\$_REQUEST['{$fpif}']);
+ \${$tableName}Obj = \${$tableName}Handler->get(\${$fpif});
\$form = \${$tableName}Obj->getForm();
\$GLOBALS['xoopsTpl']->assign('form', \$form->render());
break;\n
@@ -278,7 +288,7 @@
$ret = <<<EOT
case 'delete':
- \${$tableName}Obj =& \${$tableName}Handler->get(\$_REQUEST['{$fpif}']);
+ \${$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()));
@@ -289,7 +299,7 @@
echo \${$tableName}Obj->getHtmlErrors();
}
} else {
- xoops_confirm(array('ok' => 1, '{$fpif}' => \$_REQUEST['{$fpif}'], 'op' => 'delete'), \$_SERVER['REQUEST_URI'], sprintf({$language}FORMSUREDEL, \${$tableName}Obj->getVar('{$fpmf}')));
+ xoops_confirm(array('ok' => 1, '{$fpif}' => \${$fpif}, 'op' => 'delete'), \$_SERVER['REQUEST_URI'], sprintf({$language}FORMSUREDEL, \${$tableName}Obj->getVar('{$fpmf}')));
}
break;\n
EOT;
@@ -318,7 +328,8 @@
$table = $this->getTable();
$moduleDirname = $module->getVar('mod_dirname');
$tableName = $table->getVar('table_name');
- $tableFieldname = $table->getVar('table_fieldname');
+ $tableFieldname = $table->getVar('table_fieldname');
+ $tableAutoincrement = $table->getVar('table_autoincrement');
$language = $this->getLanguage($moduleDirname, 'AM');
$fields = $this->getTableFields($table->getVar('table_id'));
foreach(array_keys($fields) as $f)
@@ -332,8 +343,8 @@
}
}
$content = $this->getHeaderFilesComments($module, $filename);
- $content .= $this->getAdminPagesHeader($moduleDirname, $tableName);
- $content .= $this->getAdminPagesList($moduleDirname, $tableName, $tableFieldname, $language, $fields, $fpif, $fpmf);
+ $content .= $this->getAdminPagesHeader($moduleDirname, $tableName, $fpif);
+ $content .= $this->getAdminPagesList($moduleDirname, $tableName, $tableFieldname, $tableAutoincrement, $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);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/architecture.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/architecture.php 2014-07-10 18:47:00 UTC (rev 12696)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/architecture.php 2014-07-10 19:07:25 UTC (rev 12697)
@@ -106,7 +106,7 @@
$stlModuleAuthor = str_replace(' ', '', strtolower($module->getVar('mod_author')));
// Creation of the Directory in repository
$targetDirectory = $this->uploadPath.'/repository/'. $stlModuleDirname;
- $uploadImagesFolder = $this->uploadPath.'/images/repository';
+ $uploadImagesRepository = $this->uploadPath.'/images/repository';
// Creation of "module" folder
$this->structure->getPath($targetDirectory);
// Creation of "module" folder
@@ -133,7 +133,7 @@
$this->structure->makeDirAndCopyFile('assets/images', $indexFile, 'index.html');
//Copy the logo of the module
$modImage = str_replace(' ', '', strtolower($module->getVar('mod_image')));
- $this->structure->copyFile('assets/images', $uploadImagesFolder.'/'.$modImage, $modImage);
+ $this->structure->copyFile('assets/images', $uploadImagesRepository.'/'.$modImage, $modImage);
// Creation of 'images/icons' folder and index.html file - Added in Version 1.15
$this->structure->makeDirAndCopyFile('assets/images/icons', $indexFile, 'index.html');
// Creation of "images/icons/16" folder and index.html file
@@ -141,7 +141,7 @@
// Creation of "images/icons/32" folder and index.html file
$this->structure->makeDirAndCopyFile('assets/images/icons/32', $indexFile, 'index.html');
// Copy of 'module_author_logo.gif' file in uploads dir
- $logoGifFrom = $uploadImagesFolder.'/'.$stlModuleAuthor.'_logo.gif';
+ $logoGifFrom = $uploadImagesRepository.'/'.$stlModuleAuthor.'_logo.gif';
if (!file_exists($logoGifFrom)) {
copy($logosFolder.'/'.$stlModuleAuthor.'_logo.gif', $logoGifFrom);
}
@@ -203,6 +203,7 @@
$modId = $module->getVar('mod_id');
$moduleDirname = $module->getVar('mod_dirname');
$uploadTablesIcons32 = $this->uploadPath.'/images/tables';
+ $framePathIcon32 = XOOPS_ROOT_PATH . '/Frameworks/moduleclasses/icons/32';
// Id of tables
$criteriaTables = new CriteriaCompo();
$criteriaTables->add(new Criteria('table_mid', $modId));
@@ -227,9 +228,11 @@
// Get Table Object
$table = $this->tdmcreate->getHandler('tables')->get($tableId);
// Copy of tables images file
- if( file_exists($uploadTableImage = $uploadTablesIcons32.'/'.$tableImage)) {
+ if( file_exists($uploadTableImage = $uploadTablesIcons32.'/'.$tableImage )) {
$this->structure->copyFile('assets/images/icons/32', $uploadTableImage, $tableImage);
- }
+ } elseif( file_exists($uploadTableImage = $framePathIcon32.'/'.$tableImage )) {
+ $this->structure->copyFile('assets/images/icons/32', $uploadTableImage, $tableImage);
+ }
// Creation of admin files
if ( $tableAdmin == 1) {
// Admin Pages File
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/blocks/blocks.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/blocks/blocks.php 2014-07-10 18:47:00 UTC (rev 12696)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/blocks/blocks.php 2014-07-10 19:07:25 UTC (rev 12697)
@@ -101,23 +101,25 @@
{
$fieldName = $fields[$f]->getVar('field_name');
$rp_field_name = $fieldName;
- // Verify if table_fieldname is not empty
- if(!empty($tableFieldname)) {
- if(strpos($fieldName, '_')) {
- $str = strpos($fieldName, '_');
- if($str !== false){
- $rp_field_name = substr($fieldName, $str + 1, strlen($fieldName));
- }
- }
- $tname = $tableFieldname;
- $ret .= <<<EOT
+ if( $fields[$f]->getVar('field_block') == 1 ) {
+ // Verify if table_fieldname is not empty
+ if(!empty($tableFieldname)) {
+ if(strpos($fieldName, '_')) {
+ $str = strpos($fieldName, '_');
+ if($str !== false){
+ $rp_field_name = substr($fieldName, $str + 1, strlen($fieldName));
+ }
+ }
+ $tname = $tableFieldname;
+ $ret .= <<<EOT
\${$tname}['{$rp_field_name}'] = \${$tableName}_arr[\$i]->getVar('{$fieldName}');\n
EOT;
- } else {
- $tname = $tableName;
- $ret .= <<<EOT
+ } else {
+ $tname = $tableName;
+ $ret .= <<<EOT
\${$tname}['{$rp_field_name}'] = \${$tableName}_arr[\$i]->getVar('{$fieldName}');\n
EOT;
+ }
}
}
$ret .= <<<EOT
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/classes/classes.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/classes/classes.php 2014-07-10 18:47:00 UTC (rev 12696)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/classes/classes.php 2014-07-10 19:07:25 UTC (rev 12697)
@@ -178,8 +178,10 @@
private function getHeadFunctionForm($module, $table)
{
$moduleDirname = $module->getVar('mod_dirname');
+ $tableName = $table->getVar('table_name');
+ $ucfTableName = ucfirst($tableName);
+ $stuTableName = strtoupper($tableName);
$language = $this->getLanguage($moduleDirname, 'AM');
- $stu_table_name = strtoupper($table->getVar('table_name'));
$this->formelements->initForm($module, $table);
$ret = <<<EOT
/*
@@ -193,11 +195,13 @@
\$action = \$_SERVER['REQUEST_URI'];
}
// Title
- \$title = \$this->isNew() ? sprintf({$language}{$stu_table_name}_ADD) : sprintf({$language}{$stu_table_name}_EDIT);
+ \$title = \$this->isNew() ? sprintf({$language}{$stuTableName}_ADD) : sprintf({$language}{$stuTableName}_EDIT);
// Get Theme Form
xoops_load('XoopsFormLoader');
\$form = new XoopsThemeForm(\$title, 'form', \$action, 'post', true);
- \$form->setExtra('enctype="multipart/form-data"');
+ \$form->setExtra('enctype="multipart/form-data"');
+ // {$ucfTableName} handler
+ \${$tableName}Handler =& \$this->{$moduleDirname}->getHandler('{$tableName}');
{$this->formelements->renderElements()}
EOT;
return $ret;
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/classes/formelements.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/classes/formelements.php 2014-07-10 18:47:00 UTC (rev 12696)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/classes/formelements.php 2014-07-10 19:07:25 UTC (rev 12697)
@@ -223,7 +223,7 @@
// Form Select
\${$fieldName}_select = new XoopsFormSelect({$language}, '{$fieldName}', \$this->getVar('{$fieldName}'));
\${$fieldName}_select->addOption('Empty');
- \${$fieldName}_select->addOptionArray({$tableName}Handler->getList());
+ \${$fieldName}_select->addOptionArray(\${$tableName}Handler->getList());
\$form->addElement( \${$fieldName}_select{$required} );\n
EOT;
return $ret;
@@ -272,24 +272,30 @@
* @private function getXoopsFormTable
* @param string $language
* @param string $moduleDirname
- * @param string $tableName
+ * @param string $table
* @param string $fields
* @param string $required
*/
private function getXoopsFormTable($language, $moduleDirname, $tableName, $fields, $required = 'false')
{
- $fieldName = '';
+ $ucfTableName = ucfirst($tableName);
foreach(array_keys($fields) as $f)
{
- if(($fields[$f]->getVar('field_parent') == 1)) {
+ if($fields[$f]->getVar('field_parent') == 1) {
$fieldName = $fields[$f]->getVar('field_name');
- }
- }
+ $field_element = $fields[$f]->getVar('field_element');
+ if($field_element > 12) {
+ $fieldelement = $this->tdmcreate->getHandler('fieldelements')->get($...
[truncated message content] |
|
From: <txm...@us...> - 2014-07-11 18:07:10
|
Revision: 12703
http://sourceforge.net/p/xoops/svn/12703
Author: txmodxoops
Date: 2014-07-11 18:06:57 +0000 (Fri, 11 Jul 2014)
Log Message:
-----------
- Reorganized for modules without tables, but always accessible in admin
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/building.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/fieldattributes.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/fieldkey.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/fieldnull.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/fieldtype.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/header.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/index.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/menu.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/architecture.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/blocks/blocks.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/classes/classes.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/classes/formelements.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/file.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/include/comment_functions.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/include/comments.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/include/common.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/include/notifications.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/language/admin.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/language/modinfo.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/sql/mysql.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/admin/pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/blocks/blocks.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/user/footer.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/user/pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/header.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/xoopsversion.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/sql/mysql.sql
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/building.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/building.php 2014-07-11 17:18:50 UTC (rev 12702)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/building.php 2014-07-11 18:06:57 UTC (rev 12703)
@@ -83,11 +83,11 @@
}
unset($nbModules);
// Redirect if there aren't tables
- $nbTables = $tdmcreate->getHandler('tables')->getCount();
+ /*$nbTables = $tdmcreate->getHandler('tables')->getCount();
if($nbTables == 0) {
redirect_header('tables.php?op=new', 2, _AM_TDMCREATE_NOTTABLES );
}
- unset($nbTables);
+ unset($nbTables);*/
include_once TDMC_PATH . '/class/building.php';
$handler = TDMCreateBuilding::getInstance();
$form = $handler->getForm();
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/fieldattributes.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/fieldattributes.php 2014-07-11 17:18:50 UTC (rev 12702)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/fieldattributes.php 2014-07-11 18:06:57 UTC (rev 12703)
@@ -32,7 +32,8 @@
public function __construct()
{
$this->XoopsObject();
- $this->initVar('fieldattribute_name', XOBJ_DTYPE_TXTBOX);
+ $this->initVar('fieldattribute_id', XOBJ_DTYPE_INT);
+ $this->initVar('fieldattribute_name', XOBJ_DTYPE_TXTBOX);
$this->initVar('fieldattribute_value', XOBJ_DTYPE_TXTBOX);
}
}
@@ -44,6 +45,6 @@
{
function __construct(&$db)
{
- parent::__construct($db, 'tdmcreate_fieldattributes', 'tdmcreatefieldattributes', 'fieldattribute_name', 'fieldattribute_value');
+ parent::__construct($db, 'tdmcreate_fieldattributes', 'tdmcreatefieldattributes', 'fieldattribute_id', 'fieldattribute_name');
}
}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/fieldkey.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/fieldkey.php 2014-07-11 17:18:50 UTC (rev 12702)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/fieldkey.php 2014-07-11 18:06:57 UTC (rev 12703)
@@ -32,6 +32,7 @@
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);
}
@@ -44,6 +45,6 @@
{
function __construct(&$db)
{
- parent::__construct($db, 'tdmcreate_fieldkey', 'tdmcreatefieldkey', 'fieldkey_name', 'fieldkey_value');
+ parent::__construct($db, 'tdmcreate_fieldkey', 'tdmcreatefieldkey', 'fieldkey_id', 'fieldkey_name');
}
}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/fieldnull.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/fieldnull.php 2014-07-11 17:18:50 UTC (rev 12702)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/fieldnull.php 2014-07-11 18:06:57 UTC (rev 12703)
@@ -31,7 +31,8 @@
*/
public function __construct()
{
- $this->XoopsObject();
+ $this->XoopsObject();
+ $this->initVar('fieldnull_id', XOBJ_DTYPE_INT);
$this->initVar('fieldnull_name', XOBJ_DTYPE_TXTBOX);
$this->initVar('fieldnull_value', XOBJ_DTYPE_TXTBOX);
}
@@ -44,6 +45,6 @@
{
function __construct(&$db)
{
- parent::__construct($db, 'tdmcreate_fieldnull', 'tdmcreatefieldnull', 'fieldnull_name', 'fieldnull_value');
+ parent::__construct($db, 'tdmcreate_fieldnull', 'tdmcreatefieldnull', 'fieldnull_id', 'fieldnull_name');
}
}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/fieldtype.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/fieldtype.php 2014-07-11 17:18:50 UTC (rev 12702)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/fieldtype.php 2014-07-11 18:06:57 UTC (rev 12703)
@@ -31,7 +31,8 @@
*/
public function __construct()
{
- $this->XoopsObject();
+ $this->XoopsObject();
+ $this->initVar('fieldtype_id', XOBJ_DTYPE_INT);
$this->initVar('fieldtype_name', XOBJ_DTYPE_TXTBOX);
$this->initVar('fieldtype_value', XOBJ_DTYPE_TXTBOX);
}
@@ -44,6 +45,6 @@
{
function __construct(&$db)
{
- parent::__construct($db, 'tdmcreate_fieldtype', 'tdmcreatefieldtype', 'fieldtype_name', 'fieldtype_value');
+ parent::__construct($db, 'tdmcreate_fieldtype', 'tdmcreatefieldtype', 'fieldtype_id', 'fieldtype_name');
}
}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/header.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/header.php 2014-07-11 17:18:50 UTC (rev 12702)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/header.php 2014-07-11 18:06:57 UTC (rev 12703)
@@ -70,15 +70,16 @@
\nrequire_once dirname(dirname(dirname(dirname(__FILE__)))). '/include/cp_header.php';
\$thisPath = dirname(dirname(__FILE__));
include_once \$thisPath.'/include/common.php';
-include_once \$thisPath.'/include/functions.php';
//\n
EOT;
- if ( $table->getVar('table_name') != '' ) {
- $content .= <<<EOT
+ if (is_object($table)) {
+ if ( $table->getVar('table_name') != '' ) {
+ $content .= <<<EOT
// Get instance of module
\${$moduleDirname} = {$ucfModuleName}Helper::getInstance();\n
EOT;
- }
+ }
+ }
$content .= <<<EOT
//
\$sysPathIcon16 = '../' . \$xoopsModule->getInfo('sysicons16');
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/index.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/index.php 2014-07-11 17:18:50 UTC (rev 12702)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/index.php 2014-07-11 18:06:57 UTC (rev 12703)
@@ -68,27 +68,39 @@
include_once 'header.php';
// Count elements\n
EOT;
- foreach (array_keys($tables) as $i)
- {
- $tableName = $tables[$i]->getVar('table_name');
- $content .= <<<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';
+\$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
+ 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
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/menu.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/menu.php 2014-07-11 17:18:50 UTC (rev 12702)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/menu.php 2014-07-11 18:06:57 UTC (rev 12703)
@@ -45,11 +45,13 @@
/*
* @public function write
* @param string $module
- * @param mixed $tables
+ * @param object $table
+ * @param array $tables
* @param string $filename
*/
- public function write($module, $tables, $filename) {
+ public function write($module, $table, $tables, $filename) {
$this->setModule($module);
+ $this->setTable($table);
$this->setTables($tables);
$this->setFileName($filename);
}
@@ -93,7 +95,7 @@
{
$fieldElement = $fields[$f]->getVar('field_element');
switch( $fieldElement ) {
- case 10:
+ case 11:
$ret = <<<EOT
\$adminmenu[\$i]['icon'] = 'assets/images/icons/32/{$tables[$t]->getVar('table_image')}';\n
EOT;
@@ -113,6 +115,7 @@
*/
public function render() {
$module = $this->getModule();
+ $table = $this->getTable();
$tables = $this->getTables();
$filename = $this->getFileName();
$moduleDirname = $module->getVar('mod_dirname');
@@ -138,7 +141,7 @@
EOT;
}
}
- if( $tablePermissions == 1 ) {
+ if (is_object($table) && $table->getVar('table_permissions') == 1) {
$menu++;
$content .= <<<EOT
\$adminmenu[\$i]['title'] = {$language}{$menu};
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/pages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/pages.php 2014-07-11 17:18:50 UTC (rev 12702)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/pages.php 2014-07-11 18:06:57 UTC (rev 12703)
@@ -116,26 +116,21 @@
foreach(array_keys($fields) as $f)
{
$fieldName = $fields[$f]->getVar('field_name');
- $rpFieldName = $fieldName;
// Verify if table_fieldname is not empty
$lpFieldName = !empty($tableFieldname) ? substr($fieldName, 0, strpos($fieldName, '_')) : $tableName;
- if(strpos($fieldName, '_')) {
- $str = strpos($fieldName, '_');
- if($str !== false){
- $rpFieldName = substr($fieldName, $str + 1, strlen($fieldName));
- }
- }
+ $rpFieldName = $this->tdmcfile->getRightString($fieldName);
+ //
$fieldElement = $fields[$f]->getVar('field_element');
if( ($fields[$f]->getVar('field_admin') == 1) || ($tableAutoincrement == 1) ) {
switch($fieldElement) {
- case 2:
case 3:
+ case 4:
$ret .= $this->adminobjects->getTextAreaGetVar($lpFieldName, $rpFieldName, $tableName, $fieldName);
break;
- case 7:
+ case 5:
$ret .= $this->adminobjects->getSelectUserGetVar($lpFieldName, $rpFieldName, $tableName, $fieldName);
break;
- case 12:
+ case 13:
$ret .= $this->adminobjects->getTextDateSelectGetVar($lpFieldName, $rpFieldName, $tableName, $fieldName);
break;
default:
@@ -215,20 +210,20 @@
$fieldElement = $fields[$f]->getVar('field_element');
if($f > 0) { // If we want to hide field id
switch($fieldElement) {
- case 4:
case 5:
+ case 6:
$ret .= $this->adminobjects->getCheckBoxOrRadioYNSetVar($tableName, $fieldName);
break;
- case 9:
+ case 10:
$ret .= $this->adminobjects->getImageListSetVar($moduleDirname, $tableName, $fieldName);
break;
- case 10:
+ case 11:
$ret .= $this->adminobjects->getUploadImageSetVar($moduleDirname, $tableName, $fieldName);
break;
- case 11:
+ case 12:
$ret .= $this->adminobjects->getUploadFileSetVar($moduleDirname, $tableName, $fieldName);
break;
- case 12:
+ case 13:
$ret .= $this->adminobjects->getTextDateSelectSetVar($tableName, $fieldName);
break;
default:
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/architecture.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/architecture.php 2014-07-11 17:18:50 UTC (rev 12702)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/architecture.php 2014-07-11 18:06:57 UTC (rev 12703)
@@ -113,16 +113,14 @@
$this->structure->makeDir($targetDirectory);
// Copied of index.html file in "root module" folder
$this->structure->copyFile('', $indexFile, 'index.html');
- if (is_object($table)) {
- if ( $table->getVar('table_admin') == 1) {
- // Creation of "admin" folder and index.html file
- $this->structure->makeDirAndCopyFile('admin', $indexFile, 'index.html');
- }
- if ( $table->getVar('table_blocks') == 1) {
- // Creation of "blocks" folder and index.html file
- $this->structure->makeDirAndCopyFile('blocks', $indexFile, 'index.html');
- }
+ if ( $module->getVar('mod_admin') == 1) {
+ // Creation of "admin" folder and index.html file
+ $this->structure->makeDirAndCopyFile('admin', $indexFile, 'index.html');
}
+ if ( $module->getVar('mod_blocks') == 1) {
+ // Creation of "blocks" folder and index.html file
+ $this->structure->makeDirAndCopyFile('blocks', $indexFile, 'index.html');
+ }
// Creation of "class" folder and index.html file
$this->structure->makeDirAndCopyFile('class', $indexFile, 'index.html');
// Creation of "assets" folder and index.html file
@@ -168,25 +166,25 @@
// Creation of "language/local_language" folder and index.html file
$this->structure->makeDirAndCopyFile('language/'.$GLOBALS['xoopsConfig']['language'], $indexFile, 'index.html');
// Creation of "language/local_language/help" folder and index.html file
- $this->structure->makeDirAndCopyFile('language/'.$GLOBALS['xoopsConfig']['language']. '/help', $indexFile, 'index.html');
- if (is_object($table)) {
- if (( $table->getVar('table_user') == 1) || ( $table->getVar('table_admin') == 1 )) {
- // Creation of "templates" folder and index.html file
- $this->structure->makeDirAndCopyFile('templates', $indexFile, 'index.html');
- }
- if ( $table->getVar('table_admin') == 1 ) {
- // Creation of "templates/admin" folder and index.html file
- $this->structure->makeDirAndCopyFile('templates/admin', $indexFile, 'index.html');
- }
- if ( $table->getVar('table_blocks') == 1 ) {
+ $this->structure->makeDirAndCopyFile('language/'.$GLOBALS['xoopsConfig']['language']. '/help', $indexFile, 'index.html');
+ if( $module->getVar('mod_admin') == 1 ) {
+ // Creation of "templates" folder and index.html file
+ $this->structure->makeDirAndCopyFile('templates', $indexFile, 'index.html');
+ }
+ if( $module->getVar('mod_admin') == 1 ) {
+ // Creation of "templates/admin" folder and index.html file
+ $this->structure->makeDirAndCopyFile('templates/admin', $indexFile, 'index.html');
+ }
+ if(is_object($table)) {
+ if( $table->getVar('table_blocks') == 1 ) {
// Creation of "templates/blocks" folder and index.html file
$this->structure->makeDirAndCopyFile('templates/blocks', $indexFile, 'index.html');
}
- if ( $table->getVar('table_name') != null ) {
+ if( $table->getVar('table_name') != null ) {
// Creation of "sql" folder and index.html file
$this->structure->makeDirAndCopyFile('sql', $indexFile, 'index.html');
}
- if ( $table->getVar('table_notifications') == 1 ) {
+ if( $table->getVar('table_notifications') == 1 ) {
// Creation of "mail_template" folder and index.html file
$this->structure->makeDirAndCopyFile('language/'.$GLOBALS['xoopsConfig']['language'].'/mail_template', $indexFile, 'index.html');
}
@@ -277,7 +275,49 @@
// Language Modinfo File
$languageModinfo = LanguageModinfo::getInstance();
$languageModinfo->write($module, $table, $tables, 'modinfo.php');
- $ret[] = $languageModinfo->render();
+ $ret[] = $languageModinfo->render();
+ if( $module->getVar('mod_admin') == 1 ) {
+ // Admin Header File
+ $adminHeader = AdminHeader::getInstance();
+ $adminHeader->write($module, $table, $tables, 'header.php');
+ $ret[] = $adminHeader->render();
+ // Admin Index File
+ $adminIndex = AdminIndex::getInstance();
+ $adminIndex->write($module, $tables, 'index.php');
+ $ret[] = $adminIndex->render();
+ // Admin Menu File
+ $adminMenu = AdminMenu::getInstance();
+ $adminMenu->write($module, $table, $tables, 'menu.php');
+ $ret[] = $adminMenu->render();
+ // Admin About File
+ $adminAbout = AdminAbout::getInstance();
+ $adminAbout->write($module, 'about.php');
+ $ret[] = $adminAbout->render();
+ // Admin Footer File
+ $adminFooter = AdminFooter::getInstance();
+ $adminFooter->write($module, 'footer.php');
+ $ret[] = $adminFooter->render();
+ // Templates Admin About File
+ $adminTemplatesAbout = TemplatesAdminAbout::getInstance();
+ $adminTemplatesAbout->write($module, $moduleDirname.'_admin_about.tpl');
+ $ret[] = $adminTemplatesAbout->render();
+ // Templates Admin Index File
+ $adminTemplatesIndex = TemplatesAdminIndex::getInstance();
+ $adminTemplatesIndex->write($module, $moduleDirname.'_admin_index.tpl');
+ $ret[] = $adminTemplatesIndex->render();
+ // Templates Admin Footer File
+ $adminTemplatesFooter = TemplatesAdminFooter::getInstance();
+ $adminTemplatesFooter->write($module, $moduleDirname.'_admin_footer.tpl');
+ $ret[] = $adminTemplatesFooter->render();
+ // Templates Admin Header File
+ $adminTemplatesHeader = TemplatesAdminHeader::getInstance();
+ $adminTemplatesHeader->write($module, $moduleDirname.'_admin_header.tpl');
+ $ret[] = $adminTemplatesHeader->render();
+ // Language Admin File
+ $languageAdmin = LanguageAdmin::getInstance();
+ $languageAdmin->write($module, $tables, 'admin.php');
+ $ret[] = $languageAdmin->render();
+ }
// Creation of blocks language file
if (is_object($table)) {
if ( $table->getVar('table_blocks') == 1) {
@@ -286,21 +326,12 @@
$languageBlocks->write($module, $tables, 'blocks.php');
$ret[] = $languageBlocks->render();
}
-
+ // Class Helper File
+ $classHelper = ClassHelper::getInstance();
+ $classHelper->write($module, 'helper.php');
+ $ret[] = $classHelper->render();
// Creation of admin files
- if ( $table->getVar('table_admin') == 1) {
- // Admin Header File
- $adminHeader = AdminHeader::getInstance();
- $adminHeader->write($module, $table, $tables, 'header.php');
- $ret[] = $adminHeader->render();
- // Admin Index File
- $adminIndex = AdminIndex::getInstance();
- $adminIndex->write($module, $tables, 'index.php');
- $ret[] = $adminIndex->render();
- // Admin Menu File
- $adminMenu = AdminMenu::getInstance();
- $adminMenu->write($module, $tables, 'menu.php');
- $ret[] = $adminMenu->render();
+ if ( $table->getVar('table_admin') == 1) {
// Creation of admin permission file
if (( $table->getVar('table_permissions') == 1)) {
// Admin Permissions File
@@ -311,35 +342,7 @@
$adminTemplatesPermissions = TemplatesAdminPermissions::getInstance();
$adminTemplatesPermissions->write($module, $moduleDirname.'_admin_permissions.tpl');
$ret[] = $adminTemplatesPermissions->render();
- }
- // Admin Aboutr File
- $adminAbout = AdminAbout::getInstance();
- $adminAbout->write($module, 'about.php');
- $ret[] = $adminAbout->render();
- // Admin Footer File
- $adminFooter = AdminFooter::getInstance();
- $adminFooter->write($module, 'footer.php');
- $ret[] = $adminFooter->render();
- // Language Admin File
- $languageAdmin = LanguageAdmin::getInstance();
- $languageAdmin->write($module, $tables, 'admin.php');
- $ret[] = $languageAdmin->render();
- // Templates Admin About File
- $adminTemplatesAbout = TemplatesAdminAbout::getInstance();
- $adminTemplatesAbout->write($module, $moduleDirname.'_admin_about.tpl');
- $ret[] = $adminTemplatesAbout->render();
- // Templates Admin Index File
- $adminTemplatesIndex = TemplatesAdminIndex::getInstance();
- $adminTemplatesIndex->write($module, $moduleDirname.'_admin_index.tpl');
- $ret[] = $adminTemplatesIndex->render();
- // Templates Admin Footer File
- $adminTemplatesFooter = TemplatesAdminFooter::getInstance();
- $adminTemplatesFooter->write($module, $moduleDirname.'_admin_footer.tpl');
- $ret[] = $adminTemplatesFooter->render();
- // Templates Admin Header File
- $adminTemplatesHeader = TemplatesAdminHeader::getInstance();
- $adminTemplatesHeader->write($module, $moduleDirname.'_admin_header.tpl');
- $ret[] = $adminTemplatesHeader->render();
+ }
}
// Creation of notifications files
if ( $table->getVar('table_notifications') == 1 ) {
@@ -361,7 +364,15 @@
// Sql File
$sqlFile = SqlFile::getInstance();
$sqlFile->write($module, $tables, 'mysql.sql');
- $ret[] = $sqlFile->render();
+ $ret[] = $sqlFile->render();
+ // Include Functions File
+ $includeFunctions = IncludeFunctions::getInstance();
+ $includeFunctions->write($module, 'functions.php');
+ $ret[] = $includeFunctions->render();
+ // Include Update File
+ $includeUpdate = IncludeUpdate::getInstance();
+ $includeUpdate->write($module, 'update.php');
+ $ret[] = $includeUpdate->renderFile();
}
// Creation of search file
if ( $table->getVar('table_search') == 1) {
@@ -398,19 +409,7 @@
$ret[] = $includeCommentFunctions->renderFile();
}
// Creation of user files
- if ( ($table->getVar('table_user') == 1)) {
- // Templates Index File
- $userTemplatesIndex = TemplatesUserIndex::getInstance();
- $userTemplatesIndex->write($module, $moduleDirname.'_index.tpl');
- $ret[] = $userTemplatesIndex->render();
- // Templates Footer File
- $userTemplatesFooter = TemplatesUserFooter::getInstance();
- $userTemplatesFooter->write($module, $table, $moduleDirname.'_footer.tpl');
- $ret[] = $userTemplatesFooter->render();
- // Templates Header File
- $userTemplatesHeader = TemplatesUserHeader::getInstance();
- $userTemplatesHeader->write($module, $tables, $moduleDirname.'_header.tpl');
- $ret[] = $userTemplatesHeader->render();
+ if ( ($table->getVar('table_user') == 1)) {
// User Footer File
$userFooter = UserFooter::getInstance();
$userFooter->write($module, 'footer.php');
@@ -434,27 +433,29 @@
$languageMain->write($module, $table, $tables, 'main.php');
$ret[] = $languageMain->render();
}
- }
- // Class Helper File
- $classHelper = ClassHelper::getInstance();
- $classHelper->write($module, 'helper.php');
- $ret[] = $classHelper->render();
+ }
+ if( $module->getVar('mod_admin') == 1 ) {
+ // Templates Index File
+ $userTemplatesIndex = TemplatesUserIndex::getInstance();
+ $userTemplatesIndex->write($module, $moduleDirname.'_index.tpl');
+ $ret[] = $userTemplatesIndex->render();
+ // Templates Footer File
+ $userTemplatesFooter = TemplatesUserFooter::getInstance();
+ $userTemplatesFooter->write($module, $table, $moduleDirname.'_footer.tpl');
+ $ret[] = $userTemplatesFooter->render();
+ // Templates Header File
+ $userTemplatesHeader = TemplatesUserHeader::getInstance();
+ $userTemplatesHeader->write($module, $tables, $moduleDirname.'_header.tpl');
+ $ret[] = $userTemplatesHeader->render();
+ }
// Css Styles File
$cssStyles = CssStyles::getInstance();
$cssStyles->write($module, 'style.css');
$ret[] = $cssStyles->render();
// Include Common File
$includeCommon = IncludeCommon::getInstance();
- $includeCommon->write($module, 'common.php');
- $ret[] = $includeCommon->render();
- // Include Functions File
- $includeFunctions = IncludeFunctions::getInstance();
- $includeFunctions->write($module, 'functions.php');
- $ret[] = $includeFunctions->render();
- // Include Update File
- $includeUpdate = IncludeUpdate::getInstance();
- $includeUpdate->write($module, 'update.php');
- $ret[] = $includeUpdate->renderFile();
+ $includeCommon->write($module, $table, 'common.php');
+ $ret[] = $includeCommon->render();
// Docs Changelog File
$docsChangelog = DocsChangelog::getInstance();
$docsChangelog->write($module, 'changelog.txt');
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/blocks/blocks.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/blocks/blocks.php 2014-07-11 17:18:50 UTC (rev 12702)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/blocks/blocks.php 2014-07-11 18:06:57 UTC (rev 12703)
@@ -56,8 +56,8 @@
* @param null
*/
public function getBlocksShow($moduleDirname, $tableName, $tableFieldname, $tableCategory, $fields, $fpif) {
- $stu_module_dirname = strtoupper($moduleDirname);
- $ucfmod_name = ucfirst($moduleDirname);
+ $stuModuleDirname = strtoupper($moduleDirname);
+ $ucfModuleDirname = ucfirst($moduleDirname);
$ret = <<<EOT
include_once XOOPS_ROOT_PATH.'/modules/{$moduleDirname}/include/common.php';
include_once XOOPS_ROOT_PATH.'/modules/{$moduleDirname}/include/functions.php';
@@ -65,12 +65,12 @@
{
include_once XOOPS_ROOT_PATH.'/modules/{$moduleDirname}/class/{$tableName}.php';
\$myts =& MyTextSanitizer::getInstance();
- \$GLOBALS['xoopsTpl']->assign('{$moduleDirname}_upload_url', {$stu_module_dirname}_UPLOAD_URL);
+ \$GLOBALS['xoopsTpl']->assign('{$moduleDirname}_upload_url', {$stuModuleDirname}_UPLOAD_URL);
\${$tableFieldname} = array();
\$type_block = \$options[0];
\$nb_{$tableName} = \$options[1];
\$lenght_title = \$options[2];
- \${$moduleDirname} = {$ucfmod_name}Helper::getInstance();
+ \${$moduleDirname} = {$ucfModuleDirname}Helper::getInstance();
\${$tableName}Handler =& \${$moduleDirname}->getHandler('{$tableName}');
\$criteria = new CriteriaCompo();
array_shift(\$options);
@@ -100,26 +100,13 @@
foreach(array_keys($fields) as $f)
{
$fieldName = $fields[$f]->getVar('field_name');
- $rp_field_name = $fieldName;
- if( $fields[$f]->getVar('field_block') == 1 ) {
- // Verify if table_fieldname is not empty
- if(!empty($tableFieldname)) {
- if(strpos($fieldName, '_')) {
- $str = strpos($fieldName, '_');
- if($str !== false){
- $rp_field_name = substr($fieldName, $str + 1, strlen($fieldName));
- }
- }
- $tname = $tableFieldname;
- $ret .= <<<EOT
- \${$tname}['{$rp_field_name}'] = \${$tableName}_arr[\$i]->getVar('{$fieldName}');\n
+ // Verify if table_fieldname is not empty
+ $lpFieldName = !empty($tableFieldname) ? substr($fieldName, 0, strpos($fieldName, '_')) : $tableName;
+ $rpFieldName = $this->tdmcfile->getRightString($fieldName);
+ if( $fields[$f]->getVar('field_block') == 1 ) {
+ $ret .= <<<EOT
+ \${$lpFieldName}['{$rpFieldName}'] = \${$tableName}_arr[\$i]->getVar('{$fieldName}');\n
EOT;
- } else {
- $tname = $tableName;
- $ret .= <<<EOT
- \${$tname}['{$rp_field_name}'] = \${$tableName}_arr[\$i]->getVar('{$fieldName}');\n
-EOT;
- }
}
}
$ret .= <<<EOT
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/classes/classes.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/fil...
[truncated message content] |
|
From: <txm...@us...> - 2014-07-12 07:41:49
|
Revision: 12704
http://sourceforge.net/p/xoops/svn/12704
Author: txmodxoops
Date: 2014-07-12 07:41:43 +0000 (Sat, 12 Jul 2014)
Log Message:
-----------
- Fixed important bugs
- Updated
- Still work to do
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/classes/classes.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/sql/mysql.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/admin/pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/xoopsversion.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/sql/mysql.sql
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/templates/admin/tdmcreate_tables.tpl
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/classes/classes.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/classes/classes.php 2014-07-11 18:06:57 UTC (rev 12703)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/classes/classes.php 2014-07-12 07:41:43 UTC (rev 12704)
@@ -81,44 +81,50 @@
{
$fieldName = $fields[$f]->getVar('field_name');
$fieldType = $fields[$f]->getVar('field_type');
+ if($fieldType > 1) {
+ $fType = $this->tdmcreate->getHandler('fieldtype')->get($fieldType);
+ $fieldTypeName = $fType->getVar('fieldtype_name');
+ } else {
+ $fieldType = null;
+ }
switch($fieldType) {
- case 'INT':
- case 'TINYINT':
- case 'MEDIUMINT':
- case 'SMALLINT':
+ case 2:
+ case 3:
+ case 4:
+ case 5:
$ret .= $this->getInitVar($fieldName, 'INT');
break;
- case 'CHAR':
- case 'VARCHAR':
- $ret .= $this->getInitVar($fieldName, 'TXTBOX');
- break;
- case 'TEXT':
- case 'TINYTEXT':
- case 'MEDIUMTEXT':
- case 'LONGTEXT':
- $ret .= $this->getInitVar($fieldName, 'TXTAREA');
- break;
- case 'FLOAT':
+ case 6:
$ret .= $this->getInitVar($fieldName, 'FLOAT');
break;
- case 'DECIMAL':
- case 'DOUBLE':
+ case 7:
+ case 8:
$ret .= $this->getInitVar($fieldName, 'DECIMAL');
break;
- case 'ENUM':
+ case 10:
$ret .= $this->getInitVar($fieldName, 'ENUM');
break;
- case 'EMAIL':
+ case 11:
$ret .= $this->getInitVar($fieldName, 'EMAIL');
break;
- case 'URL':
+ case 12:
$ret .= $this->getInitVar($fieldName, 'URL');
- break;
- case 'DATE':
- case 'DATETIME':
- case 'TIMESTAMP':
- case 'TIME':
- case 'YEAR':
+ break;
+ case 13:
+ case 14:
+ $ret .= $this->getInitVar($fieldName, 'TXTBOX');
+ break;
+ case 15:
+ case 16:
+ case 17:
+ case 18:
+ $ret .= $this->getInitVar($fieldName, 'TXTAREA');
+ break;
+ case 19:
+ case 20:
+ case 21:
+ case 22:
+ case 23:
$ret .= $this->getInitVar($fieldName, 'LTIME');
break;
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/sql/mysql.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/sql/mysql.php 2014-07-11 18:06:57 UTC (rev 12703)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/sql/mysql.php 2014-07-12 07:41:43 UTC (rev 12704)
@@ -144,55 +144,73 @@
$fieldNull = $fields[$f]->getVar('field_null');
$fieldDefault = $fields[$f]->getVar('field_default');
$fieldKey = $fields[$f]->getVar('field_key');
+ if($fieldType > 1) {
+ $fType = $this->tdmcreate->getHandler('fieldtype')->get($fieldType);
+ $fieldTypeName = $fType->getVar('fieldtype_name');
+ } else {
+ $fieldType = null;
+ }
+ if($fieldAttribute > 1) {
+ $fAttribute = $this->tdmcreate->getHandler('fieldattributes')->get($fieldAttribute);
+ $fieldAttribute = $fAttribute->getVar('fieldattribute_name');
+ } else {
+ $fieldAttribute = null;
+ }
+ if($fieldNull > 1) {
+ $fNull = $this->tdmcreate->getHandler('fieldnull')->get($fieldNull);
+ $fieldNull = $fNull->getVar('fieldnull_name');
+ } else {
+ $fieldNull = null;
+ }
if ( !empty($fieldName) )
{
switch( $fieldType ) {
- case 'TEXT':
- case 'TINYTEXT':
- case 'MEDIUMTEXT':
- case 'LONGTEXT':
- case 'DATE':
- case 'DATETIME':
- case 'TIMESTAMP':
- $type = $fieldType;
+ case 15:
+ case 16:
+ case 17:
+ case 18:
+ case 19:
+ case 20:
+ case 21:
+ $type = $fieldTypeName;
$default = null;
break;
default:
- $type = $fieldType.'('.$fieldValue.')';
+ $type = $fieldTypeName.'('.$fieldValue.')';
$default = "DEFAULT '{$fieldDefault}'";
break;
}
if( ($f == 0) && ($tableAutoincrement == 1) ) {
$row[] = $this->getFieldRow($fieldName, $type, $fieldAttribute, $fieldNull, null, 'AUTO_INCREMENT');
- $comma[$j] = $this->getKey(1, $fieldName);
+ $comma[$j] = $this->getKey(2, $fieldName);
$j++;
} elseif( ($f == 0) && ($tableAutoincrement == 0) ) {
$row[] = $this->getFieldRow($fieldName, $type, $fieldAttribute, $fieldNull, $default);
- $comma[$j] = $this->getKey(1, $fieldName);
+ $comma[$j] = $this->getKey(2, $fieldName);
$j++;
} else {
- if( $fieldKey == 'UNIQUE' || $fieldKey == 'KEY' || $fieldKey == 'INDEX' || $fieldKey == 'FULLTEXT')
+ if( $fieldKey == 3 || $fieldKey == 4 || $fieldKey == 5 || $fieldKey == 6)
{
switch( $fieldKey ) {
- case 'UNIQUE':
+ case 3:
$row[] = $this->getFieldRow($fieldName, $type, $fieldAttribute, $fieldNull, $default);
- $comma[$j] = $this->getKey(2, $fieldName);
- $j++;
- break;
- case 'KEY':
- $row[] = $this->getFieldRow($fieldName, $type, $fieldAttribute, $fieldNull, $default);
$comma[$j] = $this->getKey(3, $fieldName);
$j++;
break;
- case 'INDEX':
+ case 4:
$row[] = $this->getFieldRow($fieldName, $type, $fieldAttribute, $fieldNull, $default);
$comma[$j] = $this->getKey(4, $fieldName);
$j++;
break;
- case 'FULLTEXT':
+ case 5:
$row[] = $this->getFieldRow($fieldName, $type, $fieldAttribute, $fieldNull, $default);
$comma[$j] = $this->getKey(5, $fieldName);
$j++;
+ break;
+ case 6:
+ $row[] = $this->getFieldRow($fieldName, $type, $fieldAttribute, $fieldNull, $default);
+ $comma[$j] = $this->getKey(6, $fieldName);
+ $j++;
break;
}
} else {
@@ -266,27 +284,27 @@
*/
private function getKey($key, $fieldName) {
switch( $key ) {
- case 1: // PRIMARY KEY
+ case 2: // PRIMARY KEY
$ret = <<<SQL
PRIMARY KEY (`{$fieldName}`)
SQL;
break;
- case 2: // UNIQUE KEY
+ case 3: // UNIQUE KEY
$ret = <<<SQL
UNIQUE KEY `{$fieldName}` (`{$fieldName}`)
SQL;
break;
- case 3: // KEY
+ case 4: // KEY
$ret = <<<SQL
KEY `{$fieldName}` (`{$fieldName}`)
SQL;
break;
- case 4: // INDEX
+ case 5: // INDEX
$ret = <<<SQL
INDEX (`{$fieldName}`)
SQL;
break;
- case 5: // FULLTEXT KEY
+ case 6: // FULLTEXT KEY
$ret = <<<SQL
FULLTEXT KEY `{$fieldName}` (`{$fieldName}`)
SQL;
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/admin/pages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/admin/pages.php 2014-07-11 18:06:57 UTC (rev 12703)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/admin/pages.php 2014-07-12 07:41:43 UTC (rev 12704)
@@ -135,10 +135,10 @@
}
$ret .= <<<EOT
<td class="center">
- <a href="{$tableName}.php?op=edit&{$field_id}=<{\$list.{$rp_field_id}}>" title="<{\$smarty.const._EDIT}>">
+ <a href="{$tableName}.php?op=edit&{$field_id}=<{\$list.{$rpFieldName}}>" title="<{\$smarty.const._EDIT}>">
<img src="<{xoModuleIcons16 edit.png}>" alt="<{\$smarty.const._EDIT}>" />
</a>
- <a href="{$tableName}.php?op=delete&{$field_id}=<{\$list.{$rp_field_id}}>" title="<{\$smarty.const._DELETE}>">
+ <a href="{$tableName}.php?op=delete&{$field_id}=<{\$list.{$rpFieldName}}>" title="<{\$smarty.const._DELETE}>">
<img src="<{xoModuleIcons16 delete.png}>" alt="<{\$smarty.const._DELETE}>" />
</a>
</td>
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/xoopsversion.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/xoopsversion.php 2014-07-11 18:06:57 UTC (rev 12703)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/xoopsversion.php 2014-07-12 07:41:43 UTC (rev 12704)
@@ -359,7 +359,7 @@
$fields = $this->getTableFields($table->getVar('table_id'));
foreach (array_keys($fields) as $f)
{
- if( $fields[$f]->getVar('field_element') == 3 ) {
+ if( $fields[$f]->getVar('field_element') == 4 ) {
$ret .= <<<EOT
// Editor
xoops_load('xoopseditorhandler');
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/sql/mysql.sql
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/sql/mysql.sql 2014-07-11 18:06:57 UTC (rev 12703)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/sql/mysql.sql 2014-07-12 07:41:43 UTC (rev 12704)
@@ -140,7 +140,7 @@
)ENGINE =MyISAM;
INSERT INTO `tdmcreate_fieldtype` (`fieldtype_id`, `fieldtype_name`, `fieldtype_value`) VALUES
- (1, '', ''),
+ (1, '...', ''),
(2, 'INT', 'INT'),
(3, 'TINYINT', 'TINYINT'),
(4, 'MEDIUMINT', 'MEDIUMINT'),
@@ -177,7 +177,7 @@
)ENGINE =MyISAM;
INSERT INTO `tdmcreate_fieldattributes` (`fieldattribute_id`, `fieldattribute_name`, `fieldattribute_value`) VALUES
- (1, '', ''),
+ (1, '...', ''),
(2, 'BINARY', 'BINARY'),
(3, 'UNSIGNED', 'UNSIGNED'),
(4, 'UNSIGNED_ZEROFILL', 'UNSIGNED_ZEROFILL'),
@@ -196,7 +196,7 @@
)ENGINE =MyISAM;
INSERT INTO `tdmcreate_fieldnull` (`fieldnull_id`, `fieldnull_name`, `fieldnull_value`) VALUES
- (1, '', ''),
+ (1, '...', ''),
(2, 'NOT NULL', 'NOT NULL'),
(3, 'NULL', 'NULL');
@@ -213,7 +213,7 @@
)ENGINE =MyISAM;
INSERT INTO `tdmcreate_fieldkey` (`fieldkey_id`, `fieldkey_name`, `fieldkey_value`) VALUES
- (1, '', ''),
+ (1, '...', ''),
(2, 'PRIMARY', 'PRIMARY'),
(3, 'UNIQUE', 'UNIQUE'),
(4, 'KEY', 'KEY'),
@@ -236,7 +236,7 @@
)ENGINE =MyISAM;
INSERT INTO `tdmcreate_fieldelements` (`fieldelement_id`, `fieldelement_mid`, `fieldelement_tid`, `fieldelement_name`, `fieldelement_value`) VALUES
- (1, 0, 0, '', ''),
+ (1, 0, 0, '...', ''),
(2, 0, 0, 'Text', 'XoopsFormText'),
(3, 0, 0, 'TextArea', 'XoopsFormTextArea'),
(4, 0, 0, 'DhtmlTextArea', 'XoopsFormDhtmlTextArea'),
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/templates/admin/tdmcreate_tables.tpl
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/templates/admin/tdmcreate_tables.tpl 2014-07-11 18:06:57 UTC (rev 12703)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/templates/admin/tdmcreate_tables.tpl 2014-07-12 07:41:43 UTC (rev 12704)
@@ -32,7 +32,7 @@
</td>
<td class='center bold green'><{$module.name}></td>
<td class='center'><img src="<{$tdmc_upload_imgmod_url}>/<{$module.image}>" alt="" height="35" /></td>
- <td class='center'><img src="<{$modPathIcon16}>/nb_fields.png" alt="16" /></td>
+ <td class='center'><img src="<{$modPathIcon16}>/fields.png" alt="16" /></td>
<td class='center'><img src="<{$modPathIcon16}>/blocks.png" alt="16" /></td>
<td class='center'><img id="loading_img_admin<{$module.id}>" src="<{$modPathIcon16}>/spinner.gif" style="display:none;" title="<{$smarty.const._AM_SYSTEM_LOADING}>" alt="<{$smarty.const._AM_SYSTEM_LOADING}>" /><img style="cursor:pointer;" class="tooltip" id="img_admin<{$module.id}>" onclick="tdmcreate_setStatus( { op: 'display', mod_id: <{$module.id}>, mod_admin: <{if $module.admin == 1}>0<{else}>1<{/if}> }, 'img_admin<{$module.id}>', 'modules.php' )" src="<{xoModuleIcons16}><{$module.admin}>.png" alt="<{$smarty.const._AM_TDMCREATE_CHANGE_DISPLAY}> <{$module.name}>" title="<{$smarty.const._AM_TDMCREATE_CHANGE_DISPLAY}> <{$module.name}>" />
</td>
|
|
From: <txm...@us...> - 2014-07-13 10:24:24
|
Revision: 12709
http://sourceforge.net/p/xoops/svn/12709
Author: txmodxoops
Date: 2014-07-13 10:24:13 +0000 (Sun, 13 Jul 2014)
Log Message:
-----------
- Fixed bugs
- Updated
- Still work to do
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/objects.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/architecture.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/blocks/blocks.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/include/install.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/language/admin.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/structure.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/admin/pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/user/pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/objects.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/sql/mysql.sql
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/tables.php 2014-07-13 00:34:40 UTC (rev 12708)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/tables.php 2014-07-13 10:24:13 UTC (rev 12709)
@@ -202,7 +202,7 @@
if( $tablesObj->isNew() ) {
$tableIid = $GLOBALS['xoopsDB']->getInsertId();
$table_action='&field_mid='.$tableMid.'&field_tid='.$tableIid.'&field_numb='.$tableNumbFields.'&field_name='.$tableFieldname;
- redirect_header('fields.php?op=new'.$table_action, 5, sprintf(_AM_TDMCREATE_TABLE_FORM_SAVED_OK, $_POST['table_name']));
+ 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');
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/objects.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/objects.php 2014-07-13 00:34:40 UTC (rev 12708)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/objects.php 2014-07-13 10:24:13 UTC (rev 12709)
@@ -169,6 +169,22 @@
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
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/pages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/pages.php 2014-07-13 00:34:40 UTC (rev 12708)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/pages.php 2014-07-13 10:24:13 UTC (rev 12709)
@@ -61,7 +61,7 @@
* @param string $moduleDirname
* @param string $tableName
*/
- public function getAdminPagesHeader($moduleDirname, $tableName, $fpif) {
+ public function getAdminPagesHeader($moduleDirname, $table, $fpif) {
$ret = <<<EOT
include_once 'header.php';
@@ -127,9 +127,12 @@
case 4:
$ret .= $this->adminobjects->getTextAreaGetVar($lpFieldName, $rpFieldName, $tableName, $fieldName);
break;
- case 5:
+ case 8:
$ret .= $this->adminobjects->getSelectUserGetVar($lpFieldName, $rpFieldName, $tableName, $fieldName);
- break;
+ break;
+ case 11:
+ $ret .= $this->adminobjects->getUploadImageGetVar($lpFieldName, $rpFieldName, $tableName, $fieldName);
+ break;
case 13:
$ret .= $this->adminobjects->getTextDateSelectGetVar($lpFieldName, $rpFieldName, $tableName, $fieldName);
break;
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/architecture.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/architecture.php 2014-07-13 00:34:40 UTC (rev 12708)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/architecture.php 2014-07-13 10:24:13 UTC (rev 12709)
@@ -320,6 +320,10 @@
}
// Creation of blocks language file
if (is_object($table)) {
+ // Include Install File
+ $includeInstall = IncludeInstall::getInstance();
+ $includeInstall->write($module, $table, $tables, 'install.php');
+ $ret[] = $includeInstall->render();
if ( $table->getVar('table_blocks') == 1) {
// Language Blocks File
$languageBlocks = LanguageBlocks::getInstance();
@@ -354,11 +358,7 @@
$languageMailTpl = LanguageMailTpl::getInstance();
$languageMailTpl->write($module);
$ret[] = $languageMailTpl->renderFile('category_new_notify.tpl');
- }
- // Include Install File
- $includeInstall = IncludeInstall::getInstance();
- $includeInstall->write($module, $table, $tables, 'install.php');
- $ret[] = $includeInstall->render();
+ }
// Creation of sql file
if ( $table->getVar('table_name') != null) {
// Sql File
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/blocks/blocks.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/blocks/blocks.php 2014-07-13 00:34:40 UTC (rev 12708)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/blocks/blocks.php 2014-07-13 10:24:13 UTC (rev 12709)
@@ -60,7 +60,7 @@
$ucfModuleDirname = ucfirst($moduleDirname);
$ret = <<<EOT
include_once XOOPS_ROOT_PATH.'/modules/{$moduleDirname}/include/common.php';
-include_once XOOPS_ROOT_PATH.'/modules/{$moduleDirname}/include/functions.php';
+// Function show block
function b_{$moduleDirname}_{$tableName}_show(\$options)
{
include_once XOOPS_ROOT_PATH.'/modules/{$moduleDirname}/class/{$tableName}.php';
@@ -128,6 +128,7 @@
$stuModuleDirname = strtoupper($moduleDirname);
$ucfModuleDirname = ucfirst($moduleDirname);
$ret = <<<EOT
+// Function edit block
function b_{$moduleDirname}_{$tableName}_edit(\$options)
{
include_once XOOPS_ROOT_PATH.'/modules/{$moduleDirname}/class/{$tableName}.php';
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/include/install.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/include/install.php 2014-07-13 00:34:40 UTC (rev 12708)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/include/install.php 2014-07-13 10:24:13 UTC (rev 12709)
@@ -181,7 +181,7 @@
$fieldElement = $fields[$f]->getVar('field_element');
// All fields elements selected
switch( $fieldElement ) {
- case 10:
+ case 11:
$content .= $this->getInstallImagesFolder($moduleDirname);
foreach(array_keys($tables) as $t)
{
@@ -189,7 +189,7 @@
$content .= $this->getInstallTableImagesFolder($tableName);
}
break;
- case 11:
+ case 12:
$content .= $this->getInstallFilesFolder($moduleDirname);
foreach(array_keys($tables) as $t)
{
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/language/admin.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/language/admin.php 2014-07-13 00:34:40 UTC (rev 12708)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/language/admin.php 2014-07-13 10:24:13 UTC (rev 12709)
@@ -165,17 +165,17 @@
EOT;
switch($fieldElement)
{
- case 9:
+ case 10:
$ret .= <<<EOT
define('{$language}FORM_UPLOAD_IMAGE_LIST_{$stuTableName}', "{$fieldNameDesc} in frameworks images");\n
EOT;
break;
- case 10:
+ case 11:
$ret .= <<<EOT
define('{$language}FORM_UPLOAD_IMAGE_{$stuTableName}', "{$fieldNameDesc} in uploads images");\n
EOT;
break;
- case 11:
+ case 12:
$ret .= <<<EOT
define('{$language}FORM_UPLOAD_FILE_{$stuTableName}', "{$fieldNameDesc} in uploads files");\n
EOT;
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/structure.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/structure.php 2014-07-13 00:34:40 UTC (rev 12708)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/structure.php 2014-07-13 10:24:13 UTC (rev 12709)
@@ -43,6 +43,10 @@
*/
private $path = null;
/*
+ * @var mixed
+ */
+ //private $uploadPath = null;
+ /*
* @var string
*/
private $fromFile = null;
@@ -70,12 +74,40 @@
return $instance;
}
/*
+ * @public function setPath
+ * @param string $path
+ */
+ /*public function setPath($path) {
+ $this->path = TDMC_PATH . DIRECTORY_SEPARATOR . $path;
+ }*/
+ /*
+ * @public function setUploadPath
+ * @param string $path
+ */
+ /*public function setUploadPath($path) {
+ $this->uploadPath = TDMC_UPLOAD_PATH . DIRECTORY_SEPARATOR . $path;
+ }*/
+ /*
* @public function getPath
* @param string $path
*/
+ /*public function getPath() {
+ return $this->path;
+ }*/
+ /*
+ * @public function getUploadPath
+ * @param string $path
+ */
+ /*public function getUploadPath() {
+ return $this->uploadPath;
+ }*/
+ /*
+ * @public function getPath
+ * @param string $path
+ */
public function getPath($path) {
$this->path = $path;
- }
+ }
/*
* @public function isDir
* @param string $dname
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/admin/pages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/admin/pages.php 2014-07-13 00:34:40 UTC (rev 12708)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/admin/pages.php 2014-07-13 10:24:13 UTC (rev 12709)
@@ -58,7 +58,9 @@
* @param string $fields
* @param string $language
*/
- private function getTemplatesAdminPagesHeader($moduleDirname, $tableName, $fields, $language) {
+ private function getTemplatesAdminPagesHeader($moduleDirname, $table, $fields, $language)
+ {
+ $tableName = $table->getVar('table_name');
$ret = <<<EOT
<{include file="db:{$moduleDirname}_admin_header.tpl"}>
<{if {$tableName}_list}>
@@ -70,7 +72,8 @@
{
$fieldName = $fields[$f]->getVar('field_name');
$lang_fn = $language.strtoupper($fieldName);
- if( $fields[$f]->getVar('field_inlist') == 1 ) {
+ if( ($fields[$f]->getVar('field_inlist') == 1) || ($table->getVar('table_autoincrement') == 1)
+ ) {
$ret .= <<<EOT
<th class="center"><{\$smarty.const.{$lang_fn}}></th>\n
EOT;
@@ -90,8 +93,9 @@
* @param string $fields
* @param string $language
*/
- private function getTemplatesAdminPagesBody($moduleDirname, $tableName, $fields, $language)
+ private function getTemplatesAdminPagesBody($moduleDirname, $table, $fields, $language)
{
+ $tableName = $table->getVar('table_name');
$ret = <<<EOT
<tbody>
<{foreach item=list from=\${$tableName}_list}>
@@ -108,7 +112,7 @@
$rpFieldName = $this->tdmcfile->getRightString($fieldName);
}
$lp_field_name = substr($fieldName, 0, strpos($fieldName, '_'));
- if( $fields[$f]->getVar('field_inlist') == 1 ) {
+ if( ($fields[$f]->getVar('field_inlist') == 1) || ($table->getVar('table_autoincrement') == 1) ) {
switch( $fieldElement ) {
case 9:
$ret .= <<<EOT
@@ -156,8 +160,9 @@
* @param string $fields
* @param string $language
*/
- private function getTemplatesAdminPagesBodyFieldnameEmpty($moduleDirname, $tableName, $fields, $language)
+ private function getTemplatesAdminPagesBodyFieldnameEmpty($moduleDirname, $table, $fields, $language)
{
+ $tableName = $table->getVar('table_name');
$ret = <<<EOT
<tbody>
<{foreach item=list from=\${$tableName}_list}>
@@ -169,8 +174,8 @@
$fieldElement = $fields[$f]->getVar('field_element');
if($f == 0) {
$field_id = $fieldName;
- }
- if( $fields[$f]->getVar('field_inlist') == 1 ) {
+ }
+ if( ($fields[$f]->getVar('field_inlist') == 1) || ($table->getVar('table_autoincrement') == 1) ) {
switch( $fieldElement ) {
case 9:
$ret .= <<<EOT
@@ -222,11 +227,11 @@
<!-- Display navigation -->
<div class="xo-pagenav floatright"><{\$pagenav}></div><div class="clear spacer"></div>
<{/if}>
- <{if \$error}>
- <div class="errorMsg">
- <strong><{\$error}></strong>
- </div>
- <{/if}>
+<{/if}>
+<{if \$error}>
+ <div class="errorMsg">
+ <strong><{\$error}></strong>
+ </div>
<{/if}>
<{if \$form}>
<!-- Display form (add,edit) -->
@@ -246,16 +251,15 @@
$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'));
- $content = $this->getTemplatesAdminPagesHeader($moduleDirname, $tableName, $fields, $language);
+ $content = $this->getTemplatesAdminPagesHeader($moduleDirname, $table, $fields, $language);
// Verify if table_fieldname is not empty
if(!empty($tableFieldname)) {
- $content .= $this->getTemplatesAdminPagesBody($moduleDirname, $tableName, $fields, $language);
+ $content .= $this->getTemplatesAdminPagesBody($moduleDirname, $table, $fields, $language);
} else {
- $content .= $this->getTemplatesAdminPagesBodyFieldnameEmpty($moduleDirname, $tableName, $fields, $language);
+ $content .= $this->getTemplatesAdminPagesBodyFieldnameEmpty($moduleDirname, $table, $fields, $language);
}
$content .= $this->getTemplatesAdminPagesFooter($moduleDirname);
//
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/user/pages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/user/pages.php 2014-07-13 00:34:40 UTC (rev 12708)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/user/pages.php 2014-07-13 10:24:13 UTC (rev 12709)
@@ -71,7 +71,7 @@
{
$fieldName = $fields[$f]->getVar('field_name');
$langStuFieldName = $language.strtoupper($fieldName);
- if( $fields[$f]->getVar('field_user') == 1 ) {
+ if( ($fields[$f]->getVar('field_user') == 1) || ($table->getVar('table_autoincrement') == 1) ) {
$ret .= <<<EOT
<th class="center"><{\$smarty.const.{$langStuFieldName}}></th>\n
EOT;
@@ -103,7 +103,7 @@
$fieldName = $fields[$f]->getVar('field_name');
$fieldElement = $fields[$f]->getVar('field_element');
$rpFieldName = $this->tdmcfile->getRightString($fieldName);
- if( $fields[$f]->getVar('field_user') == 1 ) {
+ if( ($fields[$f]->getVar('field_user') == 1) || ($table->getVar('table_autoincrement') == 1) ) {
switch( $fieldElement ) {
case 9:
$ret .= <<<EOT
@@ -155,7 +155,7 @@
{
$fieldName = $fields[$f]->getVar('field_name');
$fieldElement = $fields[$f]->getVar('field_element');
- if( $fields[$f]->getVar('field_user') == 1 ) {
+ if( ($fields[$f]->getVar('field_user') == 1) || ($table->getVar('table_autoincrement') == 1) ) {
switch( $fieldElement ) {
case 9:
$ret .= <<<EOT
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/objects.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/objects.php 2014-07-13 00:34:40 UTC (rev 12708)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/objects.php 2014-07-13 10:24:13 UTC (rev 12709)
@@ -16,7 +16,7 @@
* @package tdmcreate
* @since 2.5.0
* @author Txmod Xoops http://www.txmodxoops.org
- * @version $Id: user_objects.php 12258 2014-01-02 09:33:29Z timgno $
+ * @version $Id: objects.php 12258 2014-01-02 09:33:29Z timgno $
*/
defined('XOOPS_ROOT_PATH') or die('Restricted access');
@@ -78,12 +78,28 @@
*/
public function getSimpleGetVar($lpFieldName, $rpFieldName, $tableName, $fieldName) {
$ret = <<<EOT
-\t\t\t// Get Var {$fieldName}
-\t\t\t\${$lpFieldName}['{$rpFieldName}'] = \${$tableName}_arr[\$i]->getVar('{$fieldName}');\n
+\t\t// Get Var {$fieldName}
+\t\t\${$lpFieldName}['{$rpFieldName}'] = \${$tableName}_arr[\$i]->getVar('{$fieldName}');\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// Get Var {$fieldName}
+\t\t\${$fieldName} = \${$tableName}_arr[\$i]->getVar('{$fieldName}');
+\t\t\$upload_image = \${$fieldName} ? \${$fieldName} : 'blank.gif';
+\t\t\${$lpFieldName}['{$rpFieldName}'] = \$upload_image;\n
+EOT;
+ return $ret;
+ }
+ /*
* @public function getTextAreaGetVar
* @param string $lpFieldName
* @param string $rpFieldName
@@ -92,8 +108,8 @@
*/
public function getTextAreaGetVar($lpFieldName, $rpFieldName, $tableName, $fieldName) {
$ret = <<<EOT
-\t\t\t// Get Var {$fieldName}
-\t\t\t\${$lpFieldName}['{$rpFieldName}'] = strip_tags(\${$tableName}_arr[\$i]->getVar('{$fieldName}'));\n
+\t\t// Get Var {$fieldName}
+\t\t\${$lpFieldName}['{$rpFieldName}'] = strip_tags(\${$tableName}_arr[\$i]->getVar('{$fieldName}'));\n
EOT;
return $ret;
}
@@ -106,8 +122,8 @@
*/
public function getSelectUserGetVar($lpFieldName, $rpFieldName, $tableName, $fieldName) {
$ret = <<<EOT
-\t\t\t// Get Var {$fieldName}
-\t\t\t\${$lpFieldName}['{$rpFieldName}'] = XoopsUser::getUnameFromId(\${$tableName}_arr[\$i]->getVar('{$fieldName}'), 's');\n
+\t\t// Get Var {$fieldName}
+\t\t\${$lpFieldName}['{$rpFieldName}'] = XoopsUser::getUnameFromId(\${$tableName}_arr[\$i]->getVar('{$fieldName}'), 's');\n
EOT;
return $ret;
}
@@ -120,8 +136,8 @@
*/
public function getTextDateSelectGetVar($lpFieldName, $rpFieldName, $tableName, $fieldName) {
$ret = <<<EOT
-\t\t\t// Get Var {$fieldName}
-\t\t\t\${$lpFieldName}['{$rpFieldName}'] = formatTimeStamp(\${$tableName}_arr[\$i]->getVar('{$fieldName}'), 's');\n
+\t\t// Get Var {$fieldName}
+\t\t\${$lpFieldName}['{$rpFieldName}'] = formatTimeStamp(\${$tableName}_arr[\$i]->getVar('{$fieldName}'), 's');\n
EOT;
return $ret;
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/pages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/pages.php 2014-07-13 00:34:40 UTC (rev 12708)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/pages.php 2014-07-13 10:24:13 UTC (rev 12709)
@@ -67,10 +67,10 @@
$table = $this->getTable();
$tableName = $table->getVar('table_name');
$tableFieldname = $table->getVar('table_fieldname');
- $tableAutoincrement = $table->getVar('table_autoincrement');
$stuModuleDirname = strtoupper($moduleDirname);
$stuTableName = strtoupper($tableName);
$stlTableName = strtolower($tableName);
+ $ucfTableName = ucfirst($tableName);
$ret = <<<EOT
\ninclude_once 'header.php';
\$GLOBALS['xoopsOption']['template_main'] = '{$moduleDirname}_{$tableName}.tpl';
@@ -84,9 +84,10 @@
//
\$GLOBALS['xoopsTpl']->assign('{$moduleDirname}_upload_url', {$stuModuleDirname}_UPLOAD_URL);
//
-\$criteria = new CriteriaCompo();
-\${$stlTableName}_count = \${$stlTableName}Handler->getCount(\$criteria);
-\${$stlTableName}_arr = \${$stlTableName}Handler->getAll(\$criteria);
+\$criteria{$ucfTableName} = new CriteriaCompo();
+\${$stlTableName}_count = \${$stlTableName}Handler->getCount(\$criteria{$ucfTableName});
+\${$stlTableName}_arr = \${$stlTableName}Handler->getAll(\$criteria{$ucfTableName});
+unset(\$criteria{$ucfTableName});
\$keywords = array();
if (\${$stlTableName}_count > 0) {
foreach (array_keys(\${$stlTableName}_arr) as \$i)
@@ -104,16 +105,19 @@
$fpmf = $fieldName; // fpmf = fields parameters main field
}
$fieldElement = $fields[$f]->getVar('field_element');
- if( ($fields[$f]->getVar('field_user') == 1) || ($tableAutoincrement == 1) ) {
+ if( ($fields[$f]->getVar('field_user') == 1) || ($table->getVar('table_autoincrement') == 1) ) {
switch($fieldElement) {
- case 2:
case 3:
+ case 4:
$ret .= $this->userobjects->getTextAreaGetVar($lpFieldName, $rpFieldName, $tableName, $fieldName);
break;
- case 7:
+ case 8:
$ret .= $this->userobjects->getSelectUserGetVar($lpFieldName, $rpFieldName, $tableName, $fieldName);
- break;
- case 12:
+ break;
+ case 11:
+ $ret .= $this->userobjects->getUploadImageGetVar($lpFieldName, $rpFieldName, $tableName, $fieldName);
+ break;
+ case 13:
$ret .= $this->userobjects->getTextDateSelectGetVar($lpFieldName, $rpFieldName, $tableName, $fieldName);
break;
default:
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/sql/mysql.sql
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/sql/mysql.sql 2014-07-13 00:34:40 UTC (rev 12708)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/sql/mysql.sql 2014-07-13 10:24:13 UTC (rev 12709)
@@ -110,7 +110,8 @@
`field_required` TINYINT(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`field_id`),
KEY `field_mid` (`field_mid`),
- KEY `field_tid` (`field_tid`)
+ KEY `field_tid` (`field_tid`),
+ KEY `field_name` (`field_name`)
)ENGINE =MyISAM;
#
|
|
From: <txm...@us...> - 2014-07-28 17:13:40
|
Revision: 12732
http://sourceforge.net/p/xoops/svn/12732
Author: txmodxoops
Date: 2014-07-28 17:13:26 +0000 (Mon, 28 Jul 2014)
Log Message:
-----------
- Updated
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/modules.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/header.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/objects.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/architecture.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/include/common.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/include/notifications.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/language/admin.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/language/blocks.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/language/main.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/language/modinfo.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/user/footer.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/header.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/index.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/objects.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/xoopsversion.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/sql/mysql.sql
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/templates/admin/tdmcreate_fields.tpl
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/templates/admin/tdmcreate_modules.tpl
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/templates/admin/tdmcreate_tables.tpl
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/xoops_version.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/fields.php 2014-07-28 04:36:09 UTC (rev 12731)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/fields.php 2014-07-28 17:13:26 UTC (rev 12732)
@@ -22,14 +22,14 @@
// Recovered value of arguments op in the URL $
$op = XoopsRequest::getString('op', 'list');
// Get fields Variables
-$field_mid = TDMCreate_CleanVars($_REQUEST, 'field_mid');
+/*$fieldMid = TDMCreate_CleanVars($_REQUEST, 'field_mid');
$fieldTid = TDMCreate_CleanVars($_REQUEST, 'field_tid');
$fieldNumb = TDMCreate_CleanVars($_REQUEST, 'field_numb');
-$fieldName = TDMCreate_CleanVars($_REQUEST, 'field_name', '', 'string');/**/
-/*$field_mid = XoopsRequest::getInt('field_mid');
+$fieldName = TDMCreate_CleanVars($_REQUEST, 'field_name', '', 'string');*/
+$fieldMid = XoopsRequest::getInt('field_mid');
$fieldTid = XoopsRequest::getInt('field_tid');
$fieldNumb = XoopsRequest::getInt('field_numb');
-$fieldName = XoopsRequest::getString('field_name', ''); */
+$fieldName = XoopsRequest::getString('field_name'); /**/
//
switch ($op)
{
@@ -53,66 +53,67 @@
$GLOBALS['xoopsTpl']->assign('sysPathIcon32', $sysPathIcon32);
//var_dump($sysPathIcon32);
// Redirect if there aren't modules
- $nb_modules = $tdmcreate->getHandler('modules')->getCount();
- if ( $nb_modules == 0 ) {
+ $countModules = $tdmcreate->getHandler('modules')->getCount();
+ if ( $countModules == 0 ) {
redirect_header('modules.php?op=new', 2, _AM_TDMCREATE_NOTMODULES );
}
- unset($nb_modules);
+ unset($countModules);
// Redirect if there aren't tables
- $nb_tables = $tdmcreate->getHandler('tables')->getCount();
- if ($nb_tables == 0) {
+ $countTables = $tdmcreate->getHandler('tables')->getCount();
+ if ($countTables == 0) {
redirect_header('tables.php?op=new', 2, _AM_TDMCREATE_NOTTABLES );
}
- unset($nb_tables);
+ unset($countTables);
// Get the list of tables
$criteria = new CriteriaCompo();
$criteria->setSort('table_id ASC, table_name');
$criteria->setOrder('ASC');
- $nb_tables = $tdmcreate->getHandler('tables')->getCount($criteria);
- $tables_arr = $tdmcreate->getHandler('tables')->getAll($criteria);
+ $countTables = $tdmcreate->getHandler('tables')->getCount($criteria);
+ $tablesAll = $tdmcreate->getHandler('tables')->getAll($criteria);
unset($criteria);
- if ($nb_tables > 0)
+ if ($countTables > 0)
{
- foreach (array_keys($tables_arr) as $tid)
+ foreach (array_keys($tablesAll) as $tid)
{
// Display tables list
$table['id'] = $tid;
- $table['mid'] = $tables_arr[$tid]->getVar('table_mid');
- $table['name'] = ucfirst($tables_arr[$tid]->getVar('table_name'));
- $table['image'] = $tables_arr[$tid]->getVar('table_image');
- $table['nbfields'] = $tables_arr[$tid]->getVar('table_nbfields');
- $table['autoincrement'] = $tables_arr[$tid]->getVar('table_autoincrement');
- $table['blocks'] = $tables_arr[$tid]->getVar('table_blocks');
- $table['admin'] = $tables_arr[$tid]->getVar('table_admin');
- $table['user'] = $tables_arr[$tid]->getVar('table_user');
- $table['search'] = $tables_arr[$tid]->getVar('table_search');
+ $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['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_id ASC, field_name');
$criteria->setOrder('ASC');
- $nb_fields = $tdmcreate->getHandler('fields')->getCount($criteria);
- $fields_arr = $tdmcreate->getHandler('fields')->getObjects($criteria);
+ $countFields = $tdmcreate->getHandler('fields')->getCount($criteria);
+ $fieldsAll = $tdmcreate->getHandler('fields')->getObjects($criteria);
unset($criteria);
// Display fields list
$fields = array();
$lid = 1;
- if ( $nb_fields > 0 )
+ if ( $countFields > 0 )
{
- foreach (array_keys($fields_arr) as $fid)
+ foreach (array_keys($fieldsAll) as $fid)
{
$field['id'] = $fid;
$field['lid'] = $lid;
- $field['name'] = str_replace('_', ' ', ucfirst($fields_arr[$fid]->getVar('field_name')));
- $field['parent'] = $fields_arr[$fid]->getVar('field_parent');
- $field['inlist'] = $fields_arr[$fid]->getVar('field_inlist');
- $field['inform'] = $fields_arr[$fid]->getVar('field_inform');
- $field['admin'] = $fields_arr[$fid]->getVar('field_admin');
- $field['user'] = $fields_arr[$fid]->getVar('field_user');
- $field['block'] = $fields_arr[$fid]->getVar('field_block');
- $field['main'] = $fields_arr[$fid]->getVar('field_main');
- $field['search'] = $fields_arr[$fid]->getVar('field_search');
- $field['required'] = $fields_arr[$fid]->getVar('field_required');
+ $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++;
@@ -123,14 +124,18 @@
$GLOBALS['xoopsTpl']->append('tables_list', $table);
unset($table);
}
- if ( $nb_tables > $limit ) {
+ if ( $countTables > $limit ) {
include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
- $pagenav = new XoopsPageNav($nb_tables, $limit, $start, 'start', 'op=list&limit=' . $limit);
+ $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);
- }
+ }
+ var_dump($fieldMid);
+ var_dump($fieldTid);
+ var_dump($fieldNumb);
+ var_dump($fieldName);
break;
case 'new':
@@ -144,10 +149,10 @@
$GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
// Form Add
$fieldsObj =& $tdmcreate->getHandler('fields')->create();
- $form = $fieldsObj->getFormNew($field_mid, $fieldTid, $fieldNumb, $fieldName);
+ $form = $fieldsObj->getFormNew($fieldMid, $fieldTid, $fieldNumb, $fieldName);
$GLOBALS['xoopsTpl']->assign('form', $form->render());
// Test -> Will be removed
- var_dump($field_mid);
+ var_dump($fieldMid);
var_dump($fieldTid);
var_dump($fieldNumb);
var_dump($fieldName);
@@ -172,9 +177,9 @@
$fieldsObj =& $fields->get($value);
break;
}
- if (isset($field_mid) && isset($fieldTid) && !empty($_POST['field_name'][$key])) {
+ if (isset($fieldMid) && isset($fieldTid) && !empty($_POST['field_name'][$key])) {
// Set Data
- $fieldsObj->setVar( 'field_mid', $field_mid );
+ $fieldsObj->setVar( 'field_mid', $fieldMid );
$fieldsObj->setVar( 'field_tid', $fieldTid );
$fieldsObj->setVar( 'field_numb', $fieldNumb );
$fieldsObj->setVar( 'field_name', (isset($_POST['field_name'][$key]) ? $_POST['field_name'][$key] : '') );
@@ -205,7 +210,7 @@
if ($fieldsObj->isNew()) {
// Fields Elements Handler
$fieldelementObj =& $tdmcreate->getHandler('fieldelements')->create();
- $fieldelementObj->setVar( 'fieldelement_mid', $field_mid );
+ $fieldelementObj->setVar( 'fieldelement_mid', $fieldMid );
$fieldelementObj->setVar( 'fieldelement_tid', $fieldTid );
$fieldelementObj->setVar( 'fieldelement_name', 'Table : '.ucfirst($table_name) );
$fieldelementObj->setVar( 'fieldelement_value', 'XoopsFormTables-'.ucfirst($table_name) );
@@ -234,7 +239,7 @@
// Form Edit
$fieldId = XoopsRequest::getInt('field_id');
$fieldsObj = $tdmcreate->getHandler('fields')->get( $fieldId );
- $form = $fieldsObj->getFormEdit($field_mid, $fieldTid);
+ $form = $fieldsObj->getFormEdit($fieldMid, $fieldTid);
$GLOBALS['xoopsTpl']->assign('form', $form->render());
// Test -> Will be removed
var_dump($fieldTid);
@@ -270,61 +275,46 @@
exit;
break;
- case 'display':
- $fieldId = XoopsRequest::getInt('field_id');
- // Get the list of fields
- $criteria = new CriteriaCompo();
- $criteria->add(new Criteria('field_tid', $fieldTid));
- $fields = $tdmcreate->getHandler('fields')->getObjects($criteria);
- $fieldsObj =& $tdmcreate->getHandler('fields')->get($fieldId);
- if (isset($_GET['field_tid'])) {
- if (isset($_GET['field_parent'])) {
- foreach ($fields as $field) {
- $fld_parent = $field->getVar('field_parent');
- $field_parent = ($field->getVar('field_id') == $fld_parent) ? '1' : '0';
- $fieldsObj->setVar('field_parent', $field_parent);
- }
- } elseif (isset($_GET['field_inlist'])) {
- $fld_inlist = intval($_GET['field_inlist']);
- $field_inlist = ($fld_inlist == 1) ? '0' : '1';
- $fieldsObj->setVar('field_inlist', $field_inlist);
- } elseif (isset($_GET['field_inform'])) {
- $fld_inform = intval($_GET['field_inform']);
- $field_inform = ($fld_inform == 1) ? '0' : '1';
- $fieldsObj->setVar('field_inform', $field_inform);
- } elseif (isset($_GET['field_admin'])) {
- $fld_admin = intval($_GET['field_admin']);
- $field_admin = ($fld_admin == 1) ? '0' : '1';
- $fieldsObj->setVar('field_admin', $field_admin);
- } elseif (isset($_GET['field_user'])) {
- $fld_user = intval($_GET['field_user']);
- $field_user = ($fld_user == 1) ? '0' : '1';
- $fieldsObj->setVar('field_user', $field_user);
- } elseif (isset($_GET['field_block'])) {
- $fld_block = intval($_GET['field_block']);
- $field_block = ($fld_block == 1) ? '0' : '1';
- $fieldsObj->setVar('field_block', $field_block);
- } elseif (isset($_GET['field_main'])) {
- foreach ($fields as $field) {
- $fld_main = $field->getVar('field_main');
- $field_main = ($field->getVar('field_id') == $fld_main) ? '1' : '0';
- $fieldsObj->setVar('field_main', $field_main);
- }
- } elseif (isset($_GET['field_search'])) {
- $fld_search = intval($_GET['field_search']);
- $field_search = ($fld_search == 1) ? '0' : '1';
- $fieldsObj->setVar('field_search', $field_search);
- } elseif (isset($_GET['field_required'])) {
- $fld_required = intval($_GET['field_required']);
- $field_required = ($fld_required == 1) ? '0' : '1';
- $fieldsObj->setVar('field_required', $field_required);
- }
- if ($tdmcreate->getHandler('fields')->insert($fieldsObj, true)) {
- redirect_header('fields.php', 3, _AM_TDMCREATE_TOGGLE_SUCCESS);
- } else {
- redirect_header('fields.php', 3, _AM_TDMCREATE_TOGGLE_FAILED);
- }
- }
+ case 'display':
+ //
+ $fields = $tdmcreate->getHandler('fields');
+ // Fields Handler
+ foreach($_REQUEST['field_id'] as $key => $value)
+ {
+ /*$fieldId = XoopsRequest::getInt('field_id');
+ $fieldParent = XoopsRequest::getInt('field_parent');
+ $fieldInlist = XoopsRequest::getInt('field_inlist');
+ $fieldInform = XoopsRequest::getInt('field_inform');
+ $fieldAdmin = XoopsRequest::getInt('field_admin');
+ $fieldUser = XoopsRequest::getInt('field_user');
+ $fieldBlock = XoopsRequest::getInt('field_block');
+ $fieldMain = XoopsRequest::getInt('field_main');
+ $fieldSearch = XoopsRequest::getInt('field_search');
+ $fieldRequired = XoopsRequest::getInt('field_required');*/
+
+ $fieldsObj =& $fields->get($value);
+ /*$fieldsObj->setVar('field_parent', $fieldParent);
+ $fieldsObj->setVar('field_inlist', $fieldInlist);
+ $fieldsObj->setVar('field_inform', $fieldInform);
+ $fieldsObj->setVar('field_admin', $fieldAdmin);
+ $fieldsObj->setVar('field_user', $fieldUser);
+ $fieldsObj->setVar('field_block', $fieldBlock);
+ $fieldsObj->setVar('field_main', $fieldMain);
+ $fieldsObj->setVar('field_search', $fieldSearch);
+ $fieldsObj->setVar('field_required', $fieldRequired);*/
+ $fieldsObj->setVar( 'field_parent', $_POST['field_parent'][$key]);
+ $fieldsObj->setVar( 'field_inlist', $_POST['field_inlist'][$key]);
+ $fieldsObj->setVar( 'field_inform', $_POST['field_inform'][$key]);
+ $fieldsObj->setVar( 'field_admin', $_POST['field_admin'][$key]);
+ $fieldsObj->setVar( 'field_user', $_POST['field_user'][$key]);
+ $fieldsObj->setVar( 'field_block', $_POST['field_block'][$key]);
+ $fieldsObj->setVar( 'field_main', $_POST['field_main'][$key]);
+ $fieldsObj->setVar( 'field_search', $_POST['field_search'][$key]);
+ $fieldsObj->setVar( 'field_required', $_POST['field_required'][$key]);
+ //
+ $fields->insert($fieldsObj, true);
+ }
+ redirect_header('fields.php', 3, _AM_TDMCREATE_TOGGLE_SUCCESS);
break;
}
include 'footer.php';
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/modules.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/modules.php 2014-07-28 04:36:09 UTC (rev 12731)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/modules.php 2014-07-28 17:13:26 UTC (rev 12732)
@@ -61,7 +61,8 @@
$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['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');
@@ -205,19 +206,32 @@
break;
case 'display':
- $mod_admin = XoopsRequest::getInt('mod_admin');
- $mod_user = XoopsRequest::getInt('mod_user');
- $mod_search = XoopsRequest::getInt('mod_search');
- $mod_comments = XoopsRequest::getInt('mod_comments');
- $mod_notifications = XoopsRequest::getInt('mod_notifications');
- $mod_permissions = XoopsRequest::getInt('mod_permissions');
-
- if ( $mod_id > 0 ) {
+ //if ( $mod_id > 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($mod_id);
- if(isset($mod_adminm)) {
+ 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)) {
@@ -232,7 +246,7 @@
} else {
redirect_header('modules.php', 1, _AM_TDMCREATE_TOGGLE_FAILED);
}
- }
+ //}
break;
}
include 'footer.php';
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/tables.php 2014-07-28 04:36:09 UTC (rev 12731)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/tables.php 2014-07-28 17:13:26 UTC (rev 12732)
@@ -76,7 +76,8 @@
$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['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');
@@ -248,41 +249,63 @@
}
break;
- case 'display':
- $tableBlocks = XoopsRequest::getInt('table_blocks');
- $tableAdmin = XoopsRequest::getInt('table_admin');
- $tableUser = XoopsRequest::getInt('table_user');
- $tableSubmenu = XoopsRequest::getInt('table_submenu');
- $tableSearch = XoopsRequest::getInt('table_search');
- $tableComments = XoopsRequest::getInt('table_comments');
- $tableNotifications = XoopsRequest::getInt('table_notifications');
- $tablePermissions = XoopsRequest::getInt('table_permissions');
-
- if ( $tableId > 0 ) {
- $tablesObj =& $tdmcreate->getHandler('tables')->get($tableId);
- if(isset($tableBlocks)) {
- $tablesObj->setVar('table_blocks', $tableBlocks);
- } elseif(isset($tableAdminm)) {
- $tablesObj->setVar('table_admin', $tableAdmin);
- } elseif(isset($tableUser)) {
- $tablesObj->setVar('table_user', $tableUser);
- } elseif(isset($tableSubmenu)) {
- $tablesObj->setVar('table_submenu', $tableSubmenu);
- } elseif(isset($tableSearch)) {
- $tablesObj->setVar('table_search', $tableSearch);
- } elseif(isset($tableComments)) {
- $tablesObj->setVar('table_comments', $tableComments);
- } elseif(isset($tableNotifications)) {
- $tablesObj->setVar('table_notifications', $tableNotifications);
- } elseif(isset($tablePermissions)) {
- $tablesObj->setVar('table_permissions', $tablePermissions);
+ case 'display_modules':
+ foreach($_POST['mod_id'] as $key => $value)
+ {
+ $moduleAdmin = XoopsRequest::getInt('mod_admin');
+ $moduleUser = XoopsRequest::getInt('mod_user');
+ $moduleBlocks = XoopsRequest::getInt('mod_blocks');
+ $moduleSearch = XoopsRequest::getInt('mod_search');
+ $moduleComments = XoopsRequest::getInt('mod_comments');
+ $moduleNotifications = XoopsRequest::getInt('mod_notifications');
+ $modulePermissions = XoopsRequest::getInt('mod_permissions');
+
+ if( $tableMid > 0 ) {
+ $modulesObj =& $tdmcreate->getHandler('modules')->get($tableMid);
+ $modulesObj->setVar('mod_admin', ((isset($_REQUEST['mod_admin'][$key]) == 1) ? 0 : 1));
+ $modulesObj->setVar('mod_user', ((isset($_REQUEST['mod_user'][$key]) == 1) ? 0 : 1));
+ $modulesObj->setVar('mod_blocks', ((isset($_REQUEST['mod_blocks'][$key]) == 1) ? 0 : 1));
+ $modulesObj->setVar('mod_search', ((isset($_REQUEST['mod_search'][$key]) == 1) ? 0 : 1));
+ $modulesObj->setVar('mod_comments', ((isset($_REQUEST['mod_comments'][$key]) == 1) ? 0 : 1));
+ $modulesObj->setVar('mod_notifications', ((isset($_REQUEST['mod_notifications'][$key]) == 1) ? 0 : 1));
+ $modulesObj->setVar('mod_permissions', ((isset($_REQUEST['mod_permissions'][$key]) == 1) ? 0 : 1));
+ 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);
+ }
}
- if ($tdmcreate->getHandler('tables')->insert($tablesObj, true)) {
- redirect_header('modules.php', 1, _AM_TDMCREATE_TOGGLE_SUCCESS);
- } else {
- redirect_header('modules.php', 1, _AM_TDMCREATE_TOGGLE_FAILED);
+ }
+ break;
+
+ case 'display_tables':
+ foreach($_POST['table_id'] as $key => $value)
+ {
+ $tableAdmin = XoopsRequest::getInt('table_admin');
+ $tableUser = XoopsRequest::getInt('table_user');
+ $tableBlocks = XoopsRequest::getInt('table_blocks');
+ $tableSubmenu = XoopsRequest::getInt('table_submenu');
+ $tableSearch = XoopsRequest::getInt('table_search');
+ $tableComments = XoopsRequest::getInt('table_comments');
+ $tableNotifications = XoopsRequest::getInt('table_notifications');
+ $tablePermissions = XoopsRequest::getInt('table_permissions');
+
+ if( $tableId > 0 ) {
+ $tablesObj =& $tdmcreate->getHandler('tables')->get($tableId);
+ $tablesObj->setVar('table_admin', ((isset($_REQUEST['table_admin'][$key]) == 1) ? 0 : 1));
+ $tablesObj->setVar('table_user', ((isset($_REQUEST['table_user'][$key]) == 1) ? 0 : 1));
+ $tablesObj->setVar('table_blocks', ((isset($_REQUEST['table_blocks'][$key]) == 1) ? 0 : 1));
+ $tablesObj->setVar('table_submenu', ((isset($_REQUEST['table_submenu'][$key]) == 1) ? 0 : 1));
+ $tablesObj->setVar('table_search', ((isset($_REQUEST['table_search'][$key]) == 1) ? 0 : 1));
+ $tablesObj->setVar('table_comments', ((isset($_REQUEST['table_comments'][$key]) == 1) ? 0 : 1));
+ $tablesObj->setVar('table_notifications', ((isset($_REQUEST['table_notifications'][$key]) == 1) ? 0 : 1));
+ if($tdmcreate->getHandler('tables')->insert($tablesObj, true)) {
+ redirect_header('tables.php', 1, _AM_TDMCREATE_TOGGLE_SUCCESS);
+ } else {
+ redirect_header('tables.php', 1, _AM_TDMCREATE_TOGGLE_FAILED);
+ }
}
- }
- break;
+ }
+ break;
}
include 'footer.php';
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/header.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/header.php 2014-07-28 04:36:09 UTC (rev 12731)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/header.php 2014-07-28 17:13:26 UTC (rev 12732)
@@ -45,13 +45,14 @@
* @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->setFileName($filename);
+ $this->setModule($module);
$this->setTable($table);
$this->setTables($tables);
+ $this->setFileName($filename);
}
/*
* @public function render
@@ -63,39 +64,35 @@
$tables = $this->getTables();
$filename = $this->getFileName();
$moduleDirname = $module->getVar('mod_dirname');
- $ucfModuleName = ucfirst($moduleDirname);
+ $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';
-//\n
+\$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} = {$ucfModuleName}Helper::getInstance();\n
+\${$moduleDirname} = {$ucfModuleDirname}Helper::getInstance();\n
EOT;
- }
- }
- $content .= <<<EOT
-//
-\$sysPathIcon16 = '../' . \$xoopsModule->getInfo('sysicons16');
-\$sysPathIcon32 = '../' . \$xoopsModule->getInfo('sysicons32');
-\$pathModuleAdmin = \$GLOBALS['xoopsModule']->getInfo('dirmoduleadmin');
-//
-\$modPathIcon16 = \$xoopsModule->getInfo('modicons16');
-\$modPathIcon32 = \$xoopsModule->getInfo('modicons32');
-//\n
-EOT;
- foreach (array_keys($tables) as $i)
- {
- $tableName = $tables[$i]->getVar('table_name');
- $content .= <<<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
//
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/objects.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/objects.php 2014-07-28 04:36:09 UTC (rev 12731)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/objects.php 2014-07-28 17:13:26 UTC (rev 12732)
@@ -39,7 +39,7 @@
* @param string $tableName
* @param string $fieldName
*/
- public function getSimpleSetVar($tableName, $fieldName) {
+ public function getSimpleSetVar($tableName, $fieldName) {
$ret = <<<EOT
// Set Var {$fieldName}
\${$tableName}Obj->setVar('{$fieldName}', \$_POST['{$fieldName}']);\n
@@ -169,6 +169,23 @@
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
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/pages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/pages.php 2014-07-28 04:36:09 UTC (rev 12731)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/pages.php 2014-07-28 17:13:26 UTC (rev 12732)
@@ -79,15 +79,17 @@
/*
* @public ...
[truncated message content] |
|
From: <txm...@us...> - 2014-08-07 06:47:33
|
Revision: 12734
http://sourceforge.net/p/xoops/svn/12734
Author: txmodxoops
Date: 2014-08-07 06:47:28 +0000 (Thu, 07 Aug 2014)
Log Message:
-----------
- Fixed bugs (goffy/timgno)
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/language/english/admin.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/tables.php 2014-07-28 20:17:51 UTC (rev 12733)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/tables.php 2014-08-07 06:47:28 UTC (rev 12734)
@@ -57,14 +57,14 @@
$numbModules = $tdmcreate->getHandler('modules')->getCount($criteria);
// Redirect if there aren't modules
if ( $numbModules == 0 ) {
- redirect_header('modules.php?op=new', 2, _AM_TDMCREATE_NOTMODULES );
+ 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);
// Redirect if there aren't tables
if ($numbTables == 0) {
- redirect_header('tables.php?op=new', 2, _AM_TDMCREATE_NOTTABLES );
+ redirect_header('tables.php?op=new', 10, _AM_TDMCREATE_NOTTABLES );
}
unset($numbTables);
// Display modules list
@@ -147,6 +147,12 @@
if ( !$GLOBALS['xoopsSecurity']->check() ) {
redirect_header('tables.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
}
+ // By goffy/timgno
+ if( ($tableMid == 0) {
+ redirect_header('tables.php?op=new', 10, _AM_TDMCREATE_ERROR_NO_MODULE_SEL);
+ exit();
+ }
+ //
$tables =& $tdmcreate->getHandler('tables');
if (!isset($tableId)) {
// Checking if table name exist
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/tables.php 2014-07-28 20:17:51 UTC (rev 12733)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/tables.php 2014-08-07 06:47:28 UTC (rev 12734)
@@ -106,7 +106,7 @@
//
$modules = $this->tdmcreate->getHandler('modules')->getObjects(null);
$mods_select = new XoopsFormSelect(_AM_TDMCREATE_TABLE_MODULES, 'table_mid', $table_mid);
- $mods_select->addOption($action, _AM_TDMCREATE_TABLE_MODSELOPT);
+ $mods_select->addOption(0, _AM_TDMCREATE_TABLE_MODSELOPT);
foreach ($modules as $mod) {//$mods_select->addOptionArray();
$mods_select->addOption($mod->getVar('mod_id'), $mod->getVar('mod_name'));
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/language/english/admin.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/language/english/admin.php 2014-07-28 20:17:51 UTC (rev 12733)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/language/english/admin.php 2014-08-07 06:47:28 UTC (rev 12734)
@@ -302,4 +302,6 @@
define('_AM_TDMCREATE_FILE_NOTCREATED', "Problems: Creating file <b class='red'>%s</b> in the <span class='red bold'>%s</span> folder");
//
define('_AM_TDMCREATE_BUILDING_DIRECTORY', "Files created in the directory <span class='bold'>uploads/tdmcreate/repository/</span> of the module <span class='bold green'>%s</span>");
-define('_AM_TDMCREATE_FIELD_PARAMETERS_LIST', "<b>Parameters List</b>");
\ No newline at end of file
+define('_AM_TDMCREATE_FIELD_PARAMETERS_LIST', "<b>Parameters List</b>");
+// By goffy/timgno
+define('_AM_TDMCREATE_ERROR_NO_MODULE_SEL', "ERROR: No module selected");
\ No newline at end of file
|
|
From: <txm...@us...> - 2014-08-07 07:08:38
|
Revision: 12736
http://sourceforge.net/p/xoops/svn/12736
Author: txmodxoops
Date: 2014-08-07 07:08:29 +0000 (Thu, 07 Aug 2014)
Log Message:
-----------
- Poured code @goffy since the control is done by javascript instead of using 0, we use two single quotes as string
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/language/english/admin.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/tables.php 2014-08-07 06:50:36 UTC (rev 12735)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/tables.php 2014-08-07 07:08:29 UTC (rev 12736)
@@ -146,12 +146,7 @@
case 'save':
if ( !$GLOBALS['xoopsSecurity']->check() ) {
redirect_header('tables.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
- }
- // By goffy/timgno
- if($tableMid == 0) {
- redirect_header('tables.php?op=new', 10, _AM_TDMCREATE_ERROR_NO_MODULE_SEL);
- exit();
- }
+ }
//
$tables =& $tdmcreate->getHandler('tables');
if (!isset($tableId)) {
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/tables.php 2014-08-07 06:50:36 UTC (rev 12735)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/tables.php 2014-08-07 07:08:29 UTC (rev 12736)
@@ -106,7 +106,7 @@
//
$modules = $this->tdmcreate->getHandler('modules')->getObjects(null);
$mods_select = new XoopsFormSelect(_AM_TDMCREATE_TABLE_MODULES, 'table_mid', $table_mid);
- $mods_select->addOption(0, _AM_TDMCREATE_TABLE_MODSELOPT);
+ $mods_select->addOption('', _AM_TDMCREATE_TABLE_MODSELOPT);
foreach ($modules as $mod) {//$mods_select->addOptionArray();
$mods_select->addOption($mod->getVar('mod_id'), $mod->getVar('mod_name'));
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/language/english/admin.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/language/english/admin.php 2014-08-07 06:50:36 UTC (rev 12735)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/language/english/admin.php 2014-08-07 07:08:29 UTC (rev 12736)
@@ -302,6 +302,4 @@
define('_AM_TDMCREATE_FILE_NOTCREATED', "Problems: Creating file <b class='red'>%s</b> in the <span class='red bold'>%s</span> folder");
//
define('_AM_TDMCREATE_BUILDING_DIRECTORY', "Files created in the directory <span class='bold'>uploads/tdmcreate/repository/</span> of the module <span class='bold green'>%s</span>");
-define('_AM_TDMCREATE_FIELD_PARAMETERS_LIST', "<b>Parameters List</b>");
-// By goffy/timgno
-define('_AM_TDMCREATE_ERROR_NO_MODULE_SEL', "ERROR: No module selected");
\ No newline at end of file
+define('_AM_TDMCREATE_FIELD_PARAMETERS_LIST', "<b>Parameters List</b>");
\ No newline at end of file
|
|
From: <txm...@us...> - 2014-11-23 09:41:25
|
Revision: 12867
http://sourceforge.net/p/xoops/svn/12867
Author: txmodxoops
Date: 2014-11-23 09:41:18 +0000 (Sun, 23 Nov 2014)
Log Message:
-----------
Added classes for autoLoader
Fixed bugs
Commented creation image file blank.gif in include/install.php for module repository
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/building.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/objects.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/include/common.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/include/install.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/templates/admin/tdmcreate_tables.tpl
Added Paths:
-----------
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/TDMCreateAutoload.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/cache/
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/cache/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/TDMCreateAbstract.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/TDMCreateArchitecture.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/TDMCreateFile.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/TDMCreateHtmlSmartyCodes.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/TDMCreateStructure.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/TDMCreateTableFields.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/AdminAbout.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/AdminFooter.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/AdminHeader.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/AdminIndex.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/AdminMenu.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/AdminObjects.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/AdminPages.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/AdminPermissions.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/blocks/BlocksFiles.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/classes/ClassFiles.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/classes/ClassFormElements.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/classes/ClassHelper.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/css/CssStyles.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/docs/DocsChangelog.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/docs/DocsFiles.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/include/IncludeCommentFunctions.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/include/IncludeComments.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/include/IncludeCommon.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/include/IncludeFunctions.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/include/IncludeInstall.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/include/IncludeJquery.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/include/IncludeNotifications.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/include/IncludeSearch.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/include/IncludeUpdate.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/language/LanguageAdmin.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/language/LanguageBlocks.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/language/LanguageDefines.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/language/LanguageHelp.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/language/LanguageMailTpl.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/language/LanguageMain.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/language/LanguageModinfo.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/sql/SqlFile.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/admin/TemplatesAdminAbout.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/admin/TemplatesAdminFooter.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/admin/TemplatesAdminHeader.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/admin/TemplatesAdminIndex.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/admin/TemplatesAdminPages.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/admin/TemplatesAdminPermissions.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/blocks/TemplatesBlocks.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/user/TemplatesUserFooter.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/user/TemplatesUserHeader.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/user/TemplatesUserIndex.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/user/TemplatesUserPages.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/building.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/building.php 2014-11-22 23:53:55 UTC (rev 12866)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/building.php 2014-11-23 09:41:18 UTC (rev 12867)
@@ -43,7 +43,7 @@
}
}
// Structure
- include_once TDMC_PATH . '/class/files/architecture.php';
+ include_once TDMC_PATH . '/class/files/TDMCreateArchitecture.php';
$handler = TDMCreateArchitecture::getInstance();
$handler->getPath( TDMC_PATH );
$handler->getUploadPath( TDMC_UPLOAD_PATH );
Added: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/TDMCreateAutoload.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/TDMCreateAutoload.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/TDMCreateAutoload.php 2014-11-23 09:41:18 UTC (rev 12867)
@@ -0,0 +1,195 @@
+<?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: autoloader.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';
+
+ /**
+ * @var Autoload
+ */
+ protected static $instance;
+
+ /**
+ * @var string module directory
+ */
+ protected $mod_dir;
+
+ /**
+ * @var array array('classname' => 'path/to/filename')
+ */
+ public $index = array();
+
+ protected static $class_aliases = array('Autoload' => 'TDMCreateAutoload');
+
+ protected 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
+ */
+ 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']);
+ }
+
+ /**
+ * 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;
+ }
+
+ public function getClassPath($classname) {
+ return (isset($this->index[$classname]) && isset($this->index[$classname]['path'])) ? $this->index[$classname]['path'] : null;
+ }
+}
+/*
+ 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');
Added: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/cache/index.html
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/cache/index.html (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/cache/index.html 2014-11-23 09:41:18 UTC (rev 12867)
@@ -0,0 +1 @@
+ <script>history.go(-1);</script>
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/fields.php 2014-11-22 23:53:55 UTC (rev 12866)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/fields.php 2014-11-23 09:41:18 UTC (rev 12867)
@@ -123,257 +123,297 @@
return $form;
}
- /*
- * @public function getFormNew
- *
- * @param integer $field_mid
- * @param integer $field_tid
- * @param integer $field_numb
- * @param string $f_name
- * @param mixed $action
- */
- public function getFormNew($field_mid = null, $field_tid = null, $field_numb = null, $f_name = null, $action = false)
- {
- // Header function class
- $fields_form = TDMCreateFields::getInstance();
- $form = $fields_form->getHeaderForm($action);
- //
- $table_autoincrement = $this->tdmcreate->getHandler('tables')->get($field_tid);
- //
- $class = 'even';
- for($i = 1; $i <= $field_numb; $i++) {
- $class = ($class == 'even') ? 'odd' : 'even';
- $form->addElement(new XoopsFormHidden('field_id['.$i.']', 'new'));
- $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">'.$i.'</td>'));
- // Field Name
- $this_field_name = (!empty($f_name) ? $f_name . '_' : '');
- $field_name = new XoopsFormText(_AM_TDMCREATE_FIELD_NAME, 'field_name['.$i.']', 15, 255, $this_field_name);
- $form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_name->render().'</td>'));
- // Field Type
- $fieldtype_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_TYPE, 'field_type['.$i.']');
- $fieldtype_select->addOptionArray($this->tdmcreate->getHandler('fieldtype')->getList());
- $form->addElement(new TDMCreateFormLabel('<td class="center">'.$fieldtype_select->render().'</td>'));
- // Field Value
- $value = ($i == 1) && ($table_autoincrement->getVar('table_autoincrement') == 1) ? '8' : '';
- $field_value = new XoopsFormText(_AM_TDMCREATE_FIELD_VALUE, 'field_value['.$i.']', 5, 20, $value);
- $form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_value->render().'</td>'));
- // Field Attributes
- $field_attributes_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_TYPE, 'field_attribute['.$i.']');
- $field_attributes_select->addOptionArray($this->tdmcreate->getHandler('fieldattributes')->getList());
- $form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_attributes_select->render().'</td>'));
- // Field Null
- $field_null_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_NULL, 'field_null['.$i.']');
- $field_null_select->addOptionArray($this->tdmcreate->getHandler('fieldnull')->getList());
- $form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_null_select->render().'</td>'));
- // Field Default
- $field_default = new XoopsFormText(_AM_TDMCREATE_FIELD_DEFAULT, 'field_default['.$i.']', 15, 25);
- $form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_default->render().'</td>'));
- // Field Key
- $field_key_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_KEY, 'field_key['.$i.']');
- $field_key_select->addOptionArray($this->tdmcreate->getHandler('fieldkey')->getList());
- $form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_key_select->render().'</td>'));
- // Field Void
- if( ($i == 1) && ($table_autoincrement->getVar('table_autoincrement') == 1)) {
- $form->addElement(new TDMCreateFormLabel('<td> </td></tr>'));
- } else {
- // Box header row
- $parameters_tray = new XoopsFormElementTray('', '<br />');
- // Field Elements
- $criteria_element = new CriteriaCompo();
- $criteria_element->add(new Criteria('fieldelement_tid', 0));
- $criteria_table = new CriteriaCompo();
- $criteria_table->add(new Criteria('fieldelement_mid', $field_mid));
- $field_elements_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_ELEMENT_NAME, 'field_element['.$i.']');
- $field_elements_select->addOptionArray($this->tdmcreate->getHandler('fieldelements')->getList($criteria_element));
- $field_elements_select->addOptionArray($this->tdmcreate->getHandler('fieldelements')->getList($criteria_table));
- unset($criteria_element); unset($criteria_table);
- $parameters_tray->addElement($field_elements_select);
-
- $field_parent = 0;
- $check_field_parent = new XoopsFormCheckBox(' ', 'field_parent['.$i.']');
- $check_field_parent->addOption($field_parent, _AM_TDMCREATE_FIELD_PARENT );
- $parameters_tray->addElement($check_field_parent);
-
- $field_inlist = 0;
- $check_field_inlist = new XoopsFormCheckBox(' ', 'field_inlist['.$i.']', $field_inlist);
- $check_field_inlist->addOption(1, _AM_TDMCREATE_FIELD_INLIST);
- $parameters_tray->addElement($check_field_inlist);
-
- $field_inform = 0;
- $check_field_inform = new XoopsFormCheckBox(' ', 'field_inform['.$i.']', $field_inform);
- $check_field_inform->addOption(1, _AM_TDMCREATE_FIELD_INFORM);
- $parameters_tray->addElement($check_field_inform);
+ /*
+ * @public function getFormNew
+ *
+ * @param integer $field_mid
+ * @param integer $field_tid
+ * @param integer $field_numb
+ * @param string $f_name
+ * @param mixed $action
+ */
+ public function getFormNew($field_mid = null, $field_tid = null, $field_numb = null, $f_name = null, $action = false)
+ {
+ // Header function class
+ $fields_form = TDMCreateFields::getInstance();
+ $form = $fields_form->getHeaderForm($action);
+ // Get handler tables
+ $table_obj = $this->tdmcreate->getHandler('tables')->get($field_tid); // Changed by goffy
+ $table_autoincrement = $table_obj->getVar('table_autoincrement'); // Added by goffy
+ // Loop for fields number
+ $class = 'even';
+ for($i = 1; $i <= $field_numb; $i++) {
+ $class = ($class == 'even') ? 'odd' : 'even';
+ // Replaced creation of new line by new function - goffy
+ $this->getFormNewLine($form, $class, $i, $field_mid, $field_tid, $f_name, $table_autoincrement);
+ }
+ // Footer form
+ return $fields_form->getFooterForm($form);
+ }
+
+ /*
+ * @public 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
+ */
+ public function getFormNewLine($form, $class, $i, $field_mid, $field_tid, $f_name, $table_autoincrement)
+ {
+ $form->addElement(new XoopsFormHidden('field_id['.$i.']', 'new'));
+ $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">'.$i.'</td>'));
+ // Field Name
+ $this_field_name = (!empty($f_name) ? $f_name . '_' : '');
+ $field_name = new XoopsFormText(_AM_TDMCREATE_FIELD_NAME, 'field_name['.$i.']', 15, 255, $this_field_name);
+ $form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_name->render().'</td>'));
+ // Field Type
+ $value = ($i == 1) && ($table_autoincrement == 1) ? '2' : '';
+ $fieldtype_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_TYPE, 'field_type['.$i.']', $value);
+ $fieldtype_select->addOptionArray($this->tdmcreate->getHandler('fieldtype')->getList());
+ $form->addElement(new TDMCreateFormLabel('<td class="center">'.$fieldtype_select->render().'</td>'));
+ // Field Value
+ $value = ($i == 1) && ($table_autoincrement == 1) ? '8' : '';
+ $field_value = new XoopsFormText(_AM_TDMCREATE_FIELD_VALUE, 'field_value['.$i.']', 5, 20, $value);
+ $form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_value->render().'</td>'));
+ // Field Attributes
+ $field_attributes_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_TYPE, 'field_attribute['.$i.']');
+ $field_attributes_select->addOptionArray($this->tdmcreate->getHandler('fieldattributes')->getList());
+ $form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_attributes_select->render().'</td>'));
+ // Field Null
+ $field_null_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_NULL, 'field_null['.$i.']');
+ $field_null_select->addOptionArray($this->tdmcreate->getHandler('fieldnull')->getList());
+ $form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_null_select->render().'</td>'));
+ // Field Default
+ $field_default = new XoopsFormText(_AM_TDMCREATE_FIELD_DEFAULT, 'field_default['.$i.']', 15, 25);
+ $form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_default->render().'</td>'));
+ // Field Key
+ $field_key_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_KEY, 'field_key['.$i.']');
+ $field_key_select->addOptionArray($this->tdmcreate->getHandler('fieldkey')->getList());
+ $form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_key_select->render().'</td>'));
+ // Field Void
+ if( ($i == 1) && ($table_autoincrement == 1)) {
+ $form->addElement(new TDMCreateFormLabel('<td> </td></tr>'));
+ } else {
+ // Box header row
+ $parameters_tray = new XoopsFormElementTray('', '<br />');
+ // Field Elements
+ $criteria_element = new CriteriaCompo();
+ $criteria_element->add(new Criteria('fieldelement_tid', 0));
+ $criteria_table = new CriteriaCompo();
+ $criteria_table->add(new Criteria('fieldelement_mid', $field_mid));
+ $field_elements_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_ELEMENT_NAME, 'field_element['.$i.']');
+ $field_elements_select->addOptionArray($this->tdmcreate->getHandler('fieldelements')->getList($criteria_element));
+ $field_elements_select->addOptionArray($this->tdmcreate->getHandler('fieldelements')->getList($criteria_table));
+ unset($criteria_element); unset($criteria_table);
+ $parameters_tray->addElement($field_elements_select);
+
+ $field_parent = 0;
+ $check_field_parent = new XoopsFormCheckBox(' ', 'field_parent['.$i.']');
+ $check_field_parent->addOption($field_parent, _AM_TDMCREATE_FIELD_PARENT );
+ $parameters_tray->addElement($check_field_parent);
+
+ $field_inlist = 0;
+ $check_field_inlist = new XoopsFormCheckBox(' ', 'field_inlist['.$i.']', $field_inlist);
+ $check_field_inlist->addOption(1, _AM_TDMCREATE_FIELD_INLIST);
+ $parameters_tray->addElement($check_field_inlist);
+
+ $field_inform = 0;
+ $check_field_inform = new XoopsFormCheckBox(' ', 'field_inform['.$i.']', $field_inform);
+ $check_field_inform->addOption(1, _AM_TDMCREATE_FIELD_INFORM);
+ $parameters_tray->addElement($check_field_inform);
- $field_admin = 0;
- $check_field_admin = new XoopsFormCheckBox(' ', 'field_admin['.$i.']', $field_admin);
- $check_field_admin->addOption(1, _AM_TDMCREATE_FIELD_ADMIN);
- $parameters_tray->addElement($check_field_admin);
+ $field_admin = 0;
+ $check_field_admin = new XoopsFormCheckBox(' ', 'field_admin['.$i.']', $field_admin);
+ $check_field_admin->addOption(1, _AM_TDMCREATE_FIELD_ADMIN);
+ $parameters_tray->addElement($check_field_admin);
- $field_user = 0;
- $check_field_user = new XoopsFormCheckBox(' ', 'field_user['.$i.']', $field_user);
- $check_field_user->addOption(1, _AM_TDMCREATE_FIELD_USER);
- $parameters_tray->addElement($check_field_user);
+ $field_user = 0;
+ $check_field_user = new XoopsFormCheckBox(' ', 'field_user['.$i.']', $field_user);
+ $check_field_user->addOption(1, _AM_TDMCREATE_FIELD_USER);
+ $parameters_tray->addElement($check_field_user);
- $field_block = 0;
- $check_field_block = new XoopsFormCheckBox('', 'field_block['.$i.']', $field_block);
- $check_field_block->addOption(1, _AM_TDMCREATE_FIELD_BLOCK);
- $parameters_tray->addElement($check_field_block);
-
- if(($i == 1)) {
- $field_main = 1;
- $check_field_main = new XoopsFormRadio('', 'field_main['.$i.']', $field_main);
- $check_field_main->addOption($field_main, _AM_TDMCREATE_FIELD_MAINFIELD );
- } else {
- $field_main = 0;
- $check_field_main = new XoopsFormRadio('', 'field_main['.$i.']');
- $check_field_main->addOption($field_main, _AM_TDMCREATE_FIELD_MAINFIELD );
- }
- $parameters_tray->addElement($check_field_main);
-
- $field_search = 0;
- $check_field_search = new XoopsFormCheckBox(' ', 'field_search['.$i.']', $field_search);
- $check_field_search->addOption(1, _AM_TDMCREATE_FIELD_SEARCH);
- $parameters_tray->addElement($check_field_search);
+ $field_block = 0;
+ $check_field_block = new XoopsFormCheckBox('', 'field_block['.$i.']', $field_block);
+ $check_field_block->addOption(1, _AM_TDMCREATE_FIELD_BLOCK);
+ $parameters_tray->addElement($check_field_block);
+
+ if(($i == 1)) {
+ $field_main = 1;
+ $check_field_main = new XoopsFormRadio('', 'field_main['.$i.']', $field_main);
+ $check_field_main->addOption($field_main, _AM_TDMCREATE_FIELD_MAINFIELD );
+ } else {
+ $field_main = 0;
+ $check_field_main = new XoopsFormRadio('', 'field_main['.$i.']');
+ $check_field_main->addOption($field_main, _AM_TDMCREATE_FIELD_MAINFIELD );
+ }
+ $parameters_tray->addElement($check_field_main);
+
+ $field_search = 0;
+ $check_field_search = new XoopsFormCheckBox(' ', 'field_search['.$i.']', $field_search);
+ $check_field_search->addOption(1, _AM_TDMCREATE_FIELD_SEARCH);
+ $parameters_tray->addElement($check_field_search);
- $field_required = 0;
- $check_field_required = new XoopsFormCheckBox(' ', 'field_required['.$i.']', $field_required);
- $check_field_required->addOption(1, _AM_TDMCREATE_FIELD_REQUIRED);
- $parameters_tray->addElement($check_field_required);
- $form->addElement(new TDMCreateFormLabel('<td><div class="portlet"><div class="portlet-header">'._AM_TDMCREATE_FIELD_PARAMETERS_LIST.'</div><div class="portlet-content">'.$parameters_tray->render().'</div></div></td></tr>'));
- }
- }
- // Footer form
- return $fields_form->getFooterForm($form);
- }
-
- /*
- * @public function getFormEdit
- *
- * @param integer $field_mid
- * @param integer $field_tid
- * @param mixed $action
- */
- public function getFormEdit($field_mid = null, $field_tid = null, $action = false)
- {
- // Header function class
- $fields_form = TDMCreateFields::getInstance();
- $form = $fields_form->getHeaderForm($action);
- //
- $class = 'even';
- // Get the list of fields
- $criteria = new CriteriaCompo();
- $criteria->add(new Criteria('field_mid', $field_mid));
- $criteria->add(new Criteria('field_tid', $field_tid));
- $fields = $this->tdmcreate->getHandler('fields')->getObjects($criteria);
- unset($criteria);
- $id = 1;
- foreach($fields as $field) {
- $class = ($class == 'even') ? 'odd' : 'even';
- $field_id ...
[truncated message content] |
|
From: <txm...@us...> - 2014-11-30 21:30:16
|
Revision: 12880
http://sourceforge.net/p/xoops/svn/12880
Author: txmodxoops
Date: 2014-11-30 21:30:00 +0000 (Sun, 30 Nov 2014)
Log Message:
-----------
Added new classes file for autoload
fixed bugs
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/classes/ClassFormElements.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/admin/TemplatesAdminPages.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/include/common.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/include/install.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/xoops_version.php
Added Paths:
-----------
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/TDMCreate.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/TDMCreateSession.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/UserFooter.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/UserHeader.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/UserIndex.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/UserNotificationUpdate.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/UserObjects.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/UserPages.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/UserPrint.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/UserRss.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/UserSubmit.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/UserXoopsVersion.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/form/TDMCreateThemeForm.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/html/TDMCreateFormLabel.php
Removed Paths:
-------------
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/abstract.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/about.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/footer.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/header.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/index.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/menu.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/objects.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/permissions.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/architecture.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/blocks/blocks.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/classes/classes.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/classes/formelements.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/classes/helper.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/css/styles.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/docs/changelog.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/docs/docs.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/file.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/htmlsmartycodes.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/include/comment_functions.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/include/comments.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/include/common.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/include/functions.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/include/install.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/include/jquery.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/include/notifications.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/include/search.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/include/update.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/language/admin.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/language/blocks.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/language/defines.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/language/help.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/language/mail.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/language/main.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/language/modinfo.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/sql/mysql.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/structure.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/tablefields.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/admin/about.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/admin/footer.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/admin/header.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/admin/index.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/admin/pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/admin/permissions.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/blocks/blocks.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/user/footer.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/user/header.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/user/index.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/user/pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/footer.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/header.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/index.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/notification_update.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/objects.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/print.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/rss.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/submit.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/xoopsversion.php
Added: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/TDMCreate.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/TDMCreate.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/TDMCreate.php 2014-11-30 21:30:00 UTC (rev 12880)
@@ -0,0 +1,173 @@
+<?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 trabis <lus...@gm...>
+ * @version $Id: tdmcreate.php 12258 2014-04-12 23:45:12Z timgno $
+ */
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
+
+class TDMCreate
+{
+ /**
+ * @var string
+ */
+ private $dirname = null;
+ /**
+ * @var string
+ */
+ private $module = null;
+ /**
+ * @var string
+ */
+ private $handler = null;
+ /**
+ * @var string
+ */
+ private $config = null;
+ /**
+ * @var string
+ */
+ private $debug = null;
+ /**
+ * @var array
+ */
+ private $debugArray = array();
+ /*
+ * @protected function constructor class
+ * @param mixed $debug
+ */
+ protected function __construct($debug)
+ {
+ $this->debug = $debug;
+ $this->dirname = basename(dirname(dirname(__FILE__)));
+ }
+ /*
+ * @static function &getInstance
+ * @param mixed $debug
+ */
+ public static function &getInstance($debug = false)
+ {
+ static $instance = false;
+ if (!$instance) {
+ $instance = new self($debug);
+ }
+ return $instance;
+ }
+ /*
+ * @static function getModule
+ * @param null
+ */
+ public function &getModule()
+ {
+ if ($this->module == null) {
+ $this->initModule();
+ }
+ return $this->module;
+ }
+ /*
+ * @static function getConfig
+ * @param string $name
+ */
+ public function getConfig($name = null)
+ {
+ if ($this->config == null) {
+ $this->initConfig();
+ }
+ if (!$name) {
+ $this->addLog("Getting all config");
+ return $this->config;
+ }
+ if (!isset($this->config[$name])) {
+ $this->addLog("ERROR :: CONFIG '{$name}' does not exist");
+ return null;
+ }
+ $this->addLog("Getting config '{$name}' : " . $this->config[$name]);
+ return $this->config[$name];
+ }
+ /*
+ * @static function setConfig
+ * @param string $name
+ * @param mixed $value
+ */
+ public function setConfig($name = null, $value = null)
+ {
+ if ($this->config == null) {
+ $this->initConfig();
+ }
+ $this->config[$name] = $value;
+ $this->addLog("Setting config '{$name}' : " . $this->config[$name]);
+ return $this->config[$name];
+ }
+ /*
+ * @static function getHandler
+ * @param string $name
+ */
+ public function &getHandler($name)
+ {
+ if (!isset($this->handler[$name . '_handler'])) {
+ $this->initHandler($name);
+ }
+ $this->addLog("Getting handler '{$name}'");
+ return $this->handler[$name . '_handler'];
+ }
+ /*
+ * @static function initModule
+ * @param null
+ */
+ public function initModule()
+ {
+ global $xoopsModule;
+ if (isset($xoopsModule) && is_object($xoopsModule) && $xoopsModule->getVar('dirname') == $this->dirname) {
+ $this->module = $xoopsModule;
+ } else {
+ $hModule = xoops_gethandler('module');
+ $this->module = $hModule->getByDirname($this->dirname);
+ }
+ $this->addLog('INIT MODULE');
+ }
+ /*
+ * @static function initConfig
+ * @param null
+ */
+ public function initConfig()
+ {
+ $this->addLog('INIT CONFIG');
+ $hModConfig = xoops_gethandler('config');
+ $this->config = $hModConfig->getConfigsByCat(0, $this->getModule()->getVar('mid'));
+ }
+ /*
+ * @static function initHandler
+ * @param string $name
+ */
+ public function initHandler($name)
+ {
+ $this->addLog('INIT ' . $name . ' HANDLER');
+ $this->handler[$name . '_handler'] = xoops_getModuleHandler($name, $this->dirname);
+ }
+ /*
+ * @static function addLog
+ * @param string $log
+ */
+ public function addLog($log)
+ {
+ if ($this->debug) {
+ if (is_object($GLOBALS['xoopsLogger'])) {
+ $GLOBALS['xoopsLogger']->addExtra($this->module->name(), $log);
+ }
+ }
+ }
+}
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/TDMCreateSession.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/TDMCreateSession.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/TDMCreateSession.php 2014-11-30 21:30:00 UTC (rev 12880)
@@ -0,0 +1,107 @@
+<?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 class
+ *
+ * @copyright The XUUPS Project http://sourceforge.net/projects/xuups/
+ * @license http://www.fsf.org/copyleft/gpl.html GNU public license
+ * @package TDMCreate
+ * @since 1.0
+ * @author trabis <lus...@gm...>
+ * @author Harry Fuecks (PHP Anthology Volume II)
+ * @version $Id: 1.91 session.php 12453 2014-03-28 18:34:46Z timgno $
+ */
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
+
+class TDMCreateSession
+{
+ /**
+ * Session constructor<br />
+ * Starts the session with session_start()
+ * <strong>Note:</strong> that if the session has already started,
+ * session_start() does nothing
+ */
+ protected function __construct()
+ {
+ if(!isset($_SESSION)) {
+ session_start();
+ }
+ }
+
+ /*
+ * @static function &getInstance
+ * @param null
+ */
+ public static function &getInstance()
+ {
+ static $_sess = false;
+ if (!isset($_sess)) {
+ $_sess = new self();
+ }
+ return $_sess;
+ }
+
+ /**
+ * Sets a session variable
+ *
+ * @param string $name name of variable
+ * @param mixed $value value of variable
+ *
+ * @return void
+ * @access public
+ */
+ public function setSession($name, $value)
+ {
+ $_SESSION[$name] = $value;
+ }
+
+ /**
+ * Fetches a session variable
+ *
+ * @param string $name name of variable
+ *
+ * @return mixed value of session variable
+ * @access public
+ */
+ public function getSession($name)
+ {
+ if (isset($_SESSION[$name])) {
+ return $_SESSION[$name];
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ * Deletes a session variable
+ *
+ * @param string $name name of variable
+ *
+ * @return void
+ * @access public
+ */
+ public function deleteSession($name)
+ {
+ unset($_SESSION[$name]);
+ }
+
+ /**
+ * Destroys the whole session
+ *
+ * @return void
+ * @access public
+ */
+ public function destroySession()
+ {
+ $_SESSION = array();
+ session_destroy();
+ }
+}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/fields.php 2014-11-27 22:11:13 UTC (rev 12879)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/fields.php 2014-11-30 21:30:00 UTC (rev 12880)
@@ -19,8 +19,8 @@
* @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/simplelabel.php';
-require_once 'form/themeform.php';
+require_once 'html/TDMCreateFormLabel.php';
+require_once 'form/TDMCreateThemeForm.php';
/*
* @Class TDMCreateFields
* @extends XoopsObject
Deleted: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/abstract.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/abstract.php 2014-11-27 22:11:13 UTC (rev 12879)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/abstract.php 2014-11-30 21:30:00 UTC (rev 12880)
@@ -1,137 +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: abstract.php 12258 2014-01-02 09:33:29Z timgno $
- */
-
-defined('XOOPS_ROOT_PATH') or die('Restricted access');
-
-/**
- * Abstract base class
- */
-abstract class TDMCreateAbstract
-{
- /**
- * "module" attribute fot files
- *
- * @var mixed
- */
- protected $module = null;
-
- /**
- * "table" attribute fot files
- *
- * @var mixed
- */
- protected $table = null;
-
- /**
- * "tables" attribute fot files
- *
- * @var mixed
- */
- protected $tables = null;
-
- /**
- * "fields" attribute fot files
- *
- * @var mixed
- */
- protected $fields = null;
-
- /**
- * public function setFileName
- * @param mixed $module
- */
- public function setModule($module) {
- if (is_object($module) && ($module instanceof TDMCreateModules)) {
- $this->module = $module;
- }
- }
-
- /*
- * @public function getModule
- * @param null
- */
- public function getModule() {
- return $this->module;
- }
-
- /**
- * public function setTable
- * @param mixed $table
- */
- public function setTable($table) {
- if (is_object($table) && ($table instanceof TDMCreateTables)) {
- $this->table = $table;
- }
- }
-
- /*
- * @public function getTable
- * @param null
- */
- public function getTable() {
- return $this->table;
- }
-
- /**
- * public function setTables
- * @param mixed $tables
- */
- public function setTables($tables) {
- if (is_array($tables)) {
- $this->tables = $tables;
- }
- }
-
- /*
- * @public function getTables
- * @param null
- */
- public function getTables() {
- return $this->tables;
- }
-
- /**
- * @public function setFields
- * @param mixed $fields
- */
- public function setFields($fields) {
- if (is_object($fields) && ($fields instanceof TDMCreateFields)) {
- $this->fields = $fields;
- }
- }
-
- /*
- * @public function getFields
- * @param null
- */
- public function getFields() {
- return $this->fields;
- }
-
- /**
- * Generates output for files.
- *
- * This method is abstract and must be overwritten by the child classes.
- *
- * @abstract
- */
- public function render() {}
-}
\ No newline at end of file
Deleted: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/about.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/about.php 2014-11-27 22:11:13 UTC (rev 12879)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/about.php 2014-11-30 21:30:00 UTC (rev 12880)
@@ -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.91/tdmcreate/class/files/admin/footer.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/footer.php 2014-11-27 22:11:13 UTC (rev 12879)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/footer.php 2014-11-30 21:30:00 UTC (rev 12880)
@@ -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.91/tdmcreate/class/files/admin/header.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/header.php 2014-11-27 22:11:13 UTC (rev 12879)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/header.php 2014-11-30 21:30:00 UTC (rev 12880)
@@ -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.91/tdmcreate/class/files/admin/index.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1...
[truncated message content] |
|
From: <txm...@us...> - 2014-12-06 21:54:52
|
Revision: 12888
http://sourceforge.net/p/xoops/svn/12888
Author: txmodxoops
Date: 2014-12-06 21:54:48 +0000 (Sat, 06 Dec 2014)
Log Message:
-----------
Updated
- Fixed bugs
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/header.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/building.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/TDMCreateArchitecture.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/TDMCreateFile.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/AdminPages.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/classes/ClassFormElements.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/admin/TemplatesAdminPages.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/blocks/TemplatesBlocks.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/user/TemplatesUserPages.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/modules.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/include/common.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/templates/admin/tdmcreate_fields.tpl
Added Paths:
-----------
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/TDMCreateHelper.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/TDMCreateHtmlSmartyCodes.php
Removed Paths:
-------------
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/request.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/fields.php 2014-12-04 21:57:19 UTC (rev 12887)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/fields.php 2014-12-06 21:54:48 UTC (rev 12888)
@@ -132,10 +132,10 @@
} else {
$GLOBALS['xoopsTpl']->assign('error', _AM_TDMCREATE_THEREARENT_FIELDS);
}
- var_dump($fieldMid);
+ /*var_dump($fieldMid);
var_dump($fieldTid);
var_dump($fieldNumb);
- var_dump($fieldName);
+ var_dump($fieldName);*/
break;
case 'new':
@@ -152,10 +152,10 @@
$form = $fieldsObj->getFormNew($fieldMid, $fieldTid, $fieldNumb, $fieldName);
$GLOBALS['xoopsTpl']->assign('form', $form->render());
// Test -> Will be removed
- var_dump($fieldMid);
+ /*var_dump($fieldMid);
var_dump($fieldTid);
var_dump($fieldNumb);
- var_dump($fieldName);
+ var_dump($fieldName); */
break;
case 'save':
@@ -242,7 +242,7 @@
$form = $fieldsObj->getFormEdit($fieldMid, $fieldTid);
$GLOBALS['xoopsTpl']->assign('form', $form->render());
// Test -> Will be removed
- var_dump($fieldTid);
+ //var_dump($fieldTid);
break;
case 'drag':
@@ -273,7 +273,23 @@
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();
+ }
+ } 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':
//
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/header.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/header.php 2014-12-04 21:57:19 UTC (rev 12887)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/header.php 2014-12-06 21:54:48 UTC (rev 12888)
@@ -30,7 +30,7 @@
$modPathIcon32 = $GLOBALS['xoopsModule']->getInfo('modicons32');
$pathModuleAdmin = $GLOBALS['xoopsModule']->getInfo('dirmoduleadmin');
// TDMCreate Instance
-$tdmcreate = TDMCreate::getInstance();
+$tdmcreate = TDMCreateHelper::getInstance();
// MyTextSanitizer
$myts =& MyTextSanitizer::getInstance();
if (!isset($xoopsTpl) || !is_object($xoopsTpl)) {
Added: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/TDMCreateHelper.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/TDMCreateHelper.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/TDMCreateHelper.php 2014-12-06 21:54:48 UTC (rev 12888)
@@ -0,0 +1,173 @@
+<?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 trabis <lus...@gm...>
+ * @version $Id: TDMCreateHelper.php 12258 2014-04-12 23:45:12Z timgno $
+ */
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
+
+class TDMCreateHelper
+{
+ /**
+ * @var string
+ */
+ private $dirname = null;
+ /**
+ * @var string
+ */
+ private $module = null;
+ /**
+ * @var string
+ */
+ private $handler = null;
+ /**
+ * @var string
+ */
+ private $config = null;
+ /**
+ * @var string
+ */
+ private $debug = null;
+ /**
+ * @var array
+ */
+ private $debugArray = array();
+ /*
+ * @protected function constructor class
+ * @param mixed $debug
+ */
+ protected function __construct($debug)
+ {
+ $this->debug = $debug;
+ $this->dirname = basename(dirname(dirname(__FILE__)));
+ }
+ /*
+ * @static function &getInstance
+ * @param mixed $debug
+ */
+ public static function &getInstance($debug = false)
+ {
+ static $instance = false;
+ if (!$instance) {
+ $instance = new self($debug);
+ }
+ return $instance;
+ }
+ /*
+ * @static function getModule
+ * @param null
+ */
+ public function &getModule()
+ {
+ if ($this->module == null) {
+ $this->initModule();
+ }
+ return $this->module;
+ }
+ /*
+ * @static function getConfig
+ * @param string $name
+ */
+ public function getConfig($name = null)
+ {
+ if ($this->config == null) {
+ $this->initConfig();
+ }
+ if (!$name) {
+ $this->addLog("Getting all config");
+ return $this->config;
+ }
+ if (!isset($this->config[$name])) {
+ $this->addLog("ERROR :: CONFIG '{$name}' does not exist");
+ return null;
+ }
+ $this->addLog("Getting config '{$name}' : " . $this->config[$name]);
+ return $this->config[$name];
+ }
+ /*
+ * @static function setConfig
+ * @param string $name
+ * @param mixed $value
+ */
+ public function setConfig($name = null, $value = null)
+ {
+ if ($this->config == null) {
+ $this->initConfig();
+ }
+ $this->config[$name] = $value;
+ $this->addLog("Setting config '{$name}' : " . $this->config[$name]);
+ return $this->config[$name];
+ }
+ /*
+ * @static function getHandler
+ * @param string $name
+ */
+ public function &getHandler($name)
+ {
+ if (!isset($this->handler[$name . '_handler'])) {
+ $this->initHandler($name);
+ }
+ $this->addLog("Getting handler '{$name}'");
+ return $this->handler[$name . '_handler'];
+ }
+ /*
+ * @static function initModule
+ * @param null
+ */
+ public function initModule()
+ {
+ global $xoopsModule;
+ if (isset($xoopsModule) && is_object($xoopsModule) && $xoopsModule->getVar('dirname') == $this->dirname) {
+ $this->module = $xoopsModule;
+ } else {
+ $hModule = xoops_gethandler('module');
+ $this->module = $hModule->getByDirname($this->dirname);
+ }
+ $this->addLog('INIT MODULE');
+ }
+ /*
+ * @static function initConfig
+ * @param null
+ */
+ public function initConfig()
+ {
+ $this->addLog('INIT CONFIG');
+ $hModConfig = xoops_gethandler('config');
+ $this->config = $hModConfig->getConfigsByCat(0, $this->getModule()->getVar('mid'));
+ }
+ /*
+ * @static function initHandler
+ * @param string $name
+ */
+ public function initHandler($name)
+ {
+ $this->addLog('INIT ' . $name . ' HANDLER');
+ $this->handler[$name . '_handler'] = xoops_getModuleHandler($name, $this->dirname);
+ }
+ /*
+ * @static function addLog
+ * @param string $log
+ */
+ public function addLog($log)
+ {
+ if ($this->debug) {
+ if (is_object($GLOBALS['xoopsLogger'])) {
+ $GLOBALS['xoopsLogger']->addExtra($this->module->name(), $log);
+ }
+ }
+ }
+}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/building.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/building.php 2014-12-04 21:57:19 UTC (rev 12887)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/building.php 2014-12-06 21:54:48 UTC (rev 12888)
@@ -36,7 +36,7 @@
public function __construct()
{
$this->XoopsObject();
- $this->tdmcreate = TDMCreate::getInstance();
+ $this->tdmcreate = TDMCreateHelper::getInstance();
}
/*
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/fields.php 2014-12-04 21:57:19 UTC (rev 12887)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/fields.php 2014-12-06 21:54:48 UTC (rev 12888)
@@ -38,7 +38,7 @@
*/
public function __construct()
{
- $this->tdmcreate = TDMCreate::getInstance();
+ $this->tdmcreate = TDMCreateHelper::getInstance();
$this->initVar('field_id', XOBJ_DTYPE_INT);
$this->initVar('field_mid', XOBJ_DTYPE_INT);
$this->initVar('field_tid', XOBJ_DTYPE_INT);
@@ -248,16 +248,10 @@
$check_field_block->addOption(1, _AM_TDMCREATE_FIELD_BLOCK);
$parameters_tray->addElement($check_field_block);
- if(($i == 1)) {
- $field_main = 1;
+ $field_main = ( $i == 1 ) ? 1 : 0;
$check_field_main = new XoopsFormRadio('', 'field_main['.$i.']', $field_main);
- $check_field_main->addOption($field_main, _AM_TDMCREATE_FIELD_MAINFIELD );
- } else {
- $field_main = 0;
- $check_field_main = new XoopsFormRadio('', 'field_main['.$i.']');
- $check_field_main->addOption($field_main, _AM_TDMCREATE_FIELD_MAINFIELD );
- }
- $parameters_tray->addElement($check_field_main);
+ $check_field_main->addOption($i, _AM_TDMCREATE_FIELD_MAINFIELD );
+ $parameters_tray->addElement($check_field_main);
$field_search = 0;
$check_field_search = new XoopsFormCheckBox(' ', 'field_search['.$i.']', $field_search);
@@ -379,15 +373,11 @@
$check_field_block = new XoopsFormCheckBox('', 'field_block['.$field_id.']', $field->getVar('field_block'));
$check_field_block->addOption(1, _AM_TDMCREATE_FIELD_BLOCK);
- $parameters_tray->addElement($check_field_block);
-
- $field_main = $field->getVar('field_main');
- if($field_main == 1) {
- $check_field_main = new XoopsFormRadio('', 'field_main['.$field_id.']', $field_main);
- } else {
- $check_field_main = new XoopsFormRadio('', 'field_main['.$field_id.']');
- }
- $check_field_main->addOption($field_main, _AM_TDMCREATE_FIELD_MAINFIELD );
+ $parameters_tray->addElement($check_field_block);
+
+ $field_main = $field->getVar('field_main');
+ $check_field_main = new XoopsFormRadio('', 'field_main['.$field_id.']', $field_main);
+ $check_field_main->addOption($field_id, _AM_TDMCREATE_FIELD_MAINFIELD );
$parameters_tray->addElement($check_field_main);
$check_field_search = new XoopsFormCheckBox(' ', 'field_search['.$field_id.']', $field->getVar('field_search'));
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/TDMCreateArchitecture.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/TDMCreateArchitecture.php 2014-12-04 21:57:19 UTC (rev 12887)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/TDMCreateArchitecture.php 2014-12-06 21:54:48 UTC (rev 12888)
@@ -36,7 +36,7 @@
* @param null
*/
public function __construct() {
- $this->tdmcreate = TDMCreate::getInstance();
+ $this->tdmcreate = TDMCreateHelper::getInstance();
$this->structure = TDMCreateStructure::getInstance();
}
/*
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/TDMCreateFile.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/TDMCreateFile.php 2014-12-04 21:57:19 UTC (rev 12887)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/TDMCreateFile.php 2014-12-06 21:54:48 UTC (rev 12888)
@@ -88,7 +88,7 @@
*/
public function __construct() {
$this->xoopsFile = XoopsFile::getHandler();
- $this->tdmcreate = TDMCreate::getInstance();
+ $this->tdmcreate = TDMCreateHelper::getInstance();
}
/*
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/AdminPages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/AdminPages.php 2014-12-04 21:57:19 UTC (rev 12887)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/AdminPages.php 2014-12-06 21:54:48 UTC (rev 12888)
@@ -124,7 +124,7 @@
$rpFieldName = $this->tdmcfile->getRightString($fieldName);
//
$fieldElement = $fields[$f]->getVar('field_element');
- if( ($fields[$f]->getVar('field_admin') == 1) || ($tableAutoincrement == 1) ) {
+ if( ($fields[$f]->getVar('field_admin') == 1) || ($tableAutoincrement == 1) && ($fields[$f]->getVar('field_inlist') == 1) ) {
switch($fieldElement) {
case 3:
case 4:
@@ -307,6 +307,8 @@
* @public function getAdminPagesDelete
* @param string $tableName
* @param string $language
+ * @param string $fpif
+ * @param string $fpmf
*/
public function getAdminPagesDelete($tableName, $language, $fpif, $fpmf) {
@@ -331,6 +333,33 @@
}
/*
+ * @public function getAdminPagesUpdate
+ * @param string $moduleDirname
+ * @param string $tableName
+ * @param string $language
+ * @param string $fpif
+ * @param string $fpmf
+ */
+ public function getAdminPagesUpdate($moduleDirname, $tableName, $language, $fpif, $fpmf) {
+
+ $upModuleName = strtoupper($moduleDirname);
+ $ret = <<<EOT
+ case 'update':
+ if (isset(\${$fpif})) {
+ \${$tableName}Obj =& \${$tableName}Handler->get(\${$fpif});
+ }
+ \${$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 getAdminPagesFooter
* @param null
*/
@@ -350,7 +379,7 @@
{
$module = $this->getModule();
$table = $this->getTable();
- $moduleDirname = $module->getVar('mod_dirname');
+ $moduleDirname = $module->getVar('mod_dirname');
$tableName = $table->getVar('table_name');
$tableFieldname = $table->getVar('table_fieldname');
$language = $this->getLanguage($moduleDirname, 'AM');
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/classes/ClassFormElements.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/classes/ClassFormElements.php 2014-12-04 21:57:19 UTC (rev 12887)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/classes/ClassFormElements.php 2014-12-06 21:54:48 UTC (rev 12888)
@@ -28,7 +28,7 @@
*/
public function __construct() {
parent::__construct();
- $this->tdmcreate = TDMCreate::getInstance();
+ $this->tdmcreate = TDMCreateHelper::getInstance();
}
/*
* @static function &getInstance
@@ -300,9 +300,23 @@
* @param string $fields
* @param string $required
*/
- private function getXoopsFormTopic($language, $moduleDirname, $tableName, $field_id, $field_pid, $fieldName, $field_main, $required = 'false')
+ private function getXoopsFormTopic($language, $moduleDirname, $table, $fields, $required = 'false')
{
+ $tableName = $table->getVar('table_name');
$ucfTableName = ucfirst($tableName);
+ foreach(array_keys($fields) as $f)
+ {
+ $fieldName = $fields[$f]->getVar('field_name');
+ if(($f == 0) && ($table->getVar('table_autoincrement') == 1)) {
+ $fieldId = $fieldName;
+ }
+ if($fields[$f]->getVar('field_parent') == 1) {
+ $fieldPid = $fieldName;
+ }
+ if($fields[$f]->getVar('field_main') == 1) {
+ $fieldMain = $fieldName;
+ }
+ }
$ret = <<<EOT
// Form Topic {$ucfTableName}
//\${$tableName}Handler = \$this->{$moduleDirname}->getHandler('{$tableName}');
@@ -310,9 +324,9 @@
\${$tableName} = \${$tableName}Handler->getObjects( \$criteria );
if(\${$tableName}) {
include_once(XOOPS_ROOT_PATH . '/class/tree.php');
- \${$tableName}_tree = new XoopsObjectTree( \${$tableName}, '{$field_id}', '{$field_pid}' );
- \${$field_pid} = \${$tableName}_tree->makeSelBox( '{$field_pid}', '{$field_main}', '--', \$this->getVar('{$field_pid}', 'e' ), true );
- \$form->addElement( new XoopsFormLabel ( {$language}, \${$field_pid} ){$required} );
+ \${$tableName}_tree = new XoopsObjectTree( \${$tableName}, '{$fieldId}', '{$fieldPid}' );
+ \${$fieldPid} = \${$tableName}_tree->makeSelBox( '{$fieldPid}', '{$fieldMain}', '--', \$this->getVar('{$fieldPid}', 'e' ), true );
+ \$form->addElement( new XoopsFormLabel ( {$language}, \${$fieldPid} ){$required} );
}\n
EOT;
return $ret;
@@ -399,7 +413,7 @@
}
if ($fieldElement > 13) {
if($table->getVar('table_category') == 1) {
- $ret .= $this->getXoopsFormTopic($language, $moduleDirname, $tableName, $fieldId, $fieldPid, $fieldName, $fieldMain, $required);
+ $ret .= $this->getXoopsFormTopic($language, $moduleDirname, $table, $fields, $required);
} else {
$ret .= $this->getXoopsFormTable($language, $moduleDirname, $tableName, $fieldName, $fieldElement, $required);
}
Added: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/TDMCreateHtmlSmartyCodes.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/TDMCreateHtmlSmartyCodes.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/TDMCreateHtmlSmartyCodes.php 2014-12-06 21:54:48 UTC (rev 12888)
@@ -0,0 +1,308 @@
+<?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: htmlsmartycodes.php 12258 2014-01-02 09:33:29Z timgno $
+ */
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
+
+class TDMCreateHtmlSmartyCodes extends TDMCreateFile
+{
+ /*
+ * @public function constructor
+ * @param null
+ */
+ public function __construct() {
+ parent::__construct();
+ }
+ /*
+ * @static function &getInstance
+ * @param null
+ */
+ public static function &getInstance()
+ {
+ static $instance = false;
+ if (!$instance) {
+ $instance = new self();
+ }
+ return $instance;
+ }
+ /*
+ * @public function getHtmlDiv
+ * @param string $class
+ * @param string $content
+ */
+ public function getHtmlDiv($class = 'bnone', $content = '') {
+ $ret = <<<EOT
+ <div class='{$class}'>
+ {$content}
+ </div>
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function getHtmlSpan
+ * @param string $class
+ * @param string $content
+ */
+ public function getHtmlSpan($class = 'bnone', $content = '') {
+ $ret = <<<EOT
+ <span class='{$class}'>
+ {$content}
+ </span>
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function getHtmlParagraph
+ * @param string $class
+ * @param string $content
+ */
+ public function getHtmlParagraph($class = 'bnone', $content = '') {
+ $ret = <<<EOT
+ <p class='{$class}'>
+ {$content}
+ </p>
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function getHtmlAnchor
+ * @param string $class
+ * @param string $url
+ * @param string $target
+ * @param string $content
+ */
+ public function getHtmlAnchor($class = 'bnone', $url = 'http://', $target = '_top', $content = '') {
+ $ret = <<<EOT
+ <a class='{$class}' href='{$url}' target='{$target}'>
+ {$content}
+ </a>
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function getHtmlImage
+ * @param string $class
+ * @param string $src
+ * @param string $alt
+ */
+ public function getHtmlImage($class = 'bnone', $src = 'blank.gif', $alt = 'blank.gif') {
+ $ret = <<<EOT
+ <img class='{$class}' src='{$src}' alt='{$alt}' />
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function getHtmlTable
+ * @param string $class
+ * @param string $content
+ */
+ public function getHtmlTable($class = 'bnone', $content = '') {
+ $ret = <<<EOT
+ <table class='{$class}'>
+ {$content}
+ </table>
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function getHtmlTableThead
+ * @param string $class
+ * @param string $content
+ */
+ public function getHtmlTableThead($class = 'bnone', $content = '') {
+ $ret = <<<EOT
+ <thead class='{$class}'>
+ {$content}
+ </thead>
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function getHtmlTableTbody
+ * @param string $class
+ * @param string $content
+ */
+ public function getHtmlTableTbody($class = 'bnone', $content = '') {
+ $ret = <<<EOT
+ <tbody class='{$class}'>
+ {$content}
+ </tbody>
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function getHtmlTableTfoot
+ * @param string $class
+ * @param string $content
+ */
+ public function getHtmlTableTfoot($class = 'bnone', $content = '') {
+ $ret = <<<EOT
+ <tfoot class='{$class}'>
+ {$content}
+ </tfoot>
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function getHtmlTableHead
+ * @param string $class
+ * @param string $content
+ */
+ public function getHtmlTableHead($class = 'bnone', $content = '') {
+ $ret = <<<EOT
+ <th class='{$class}'>{$content}</th>
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function getHtmlTableRow
+ * @param string $class
+ * @param string $content
+ */
+ public function getHtmlTableRow($class = 'bnone', $content = '') {
+ $ret = <<<EOT
+ <tr class='{$class}'>
+ {$content}
+ </tr>
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function getHtmlTableData
+ * @param string $class
+ * @param string $content
+ */
+ public function getHtmlTableData($class = 'bnone', $content = '') {
+ $ret = <<<EOT
+ <td class='{$class}'>{$content}</td>
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function getSmartyConst
+ * @param string $language
+ * @param mixed $fieldName
+ */
+ public function getSmartyConst($language, $fieldName) {
+ $ret = <<<EOT
+ <{\$smarty.const.{$language}{$fieldName}}>
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function getSmartyTableFieldNameEmptyData
+ * @param string $tableName
+ * @param string $fieldName
+ */
+ public function getSmartyTableFieldNameEmptyData($tableName = '', $fieldName = '') {
+ $ret = <<<EOT
+ <{\${$tableName}.{$fieldName}}>
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function getSmartyTableField
+ * @param string $tableFieldname
+ * @param string $fieldName
+ */
+ public function getSmartyTableFieldData($tableFieldname = '', $fieldName = '') {
+ $ret = <<<EOT
+ <{\${$tableFieldname}.{$fieldName}}>
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function getSmartyIncludeFile
+ * @param string $name
+ */
+ public function getSmartyIncludeFile($moduleDirname, $tableName = 'header') {
+ $ret = <<<EOT
+ <{include file='db:{$moduleDirname}_{$tableName}.html'}>
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function getSmartyConditions
+ * @param string $condition
+ * @param string $operator
+ * @param string $type
+ * @param string $content_if
+ * @param mixed $content_else
+ */
+ public function getSmartyConditions($condition = '', $operator = '==', $type = '1', $content_if = '', $content_else = false) {
+ if(!$content_else) {
+ $ret = <<<EOT
+ <{if ${$condition} {$operator} {$type}'}>
+ {$content_if}
+ <{/if}>
+EOT;
+ } else {
+ $ret = <<<EOT
+ <{if ${$condition} {$operator} {$type}'}>
+ {$content_if}
+ <{else}>
+ {$content_else}
+ <{/if}>
+EOT;
+ }
+ return $ret;
+ }
+ /*
+ * @public function getSmartyForeach
+ * @param string $item
+ * @param string $from
+ * @param string $content
+ */
+ public function getSmartyForeach($item = 'item', $from = 'from', $content = 'content') {
+ $ret = <<<EOT
+ <{foreach item={$item} from=${$from}}>
+ {$content}
+ <{/foreach}>
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function getSmartyForeachQuery
+ * @param string $item
+ * @param string $from
+ * @param string $content
+ */
+ public function getSmartyForeachQuery($item = 'item', $from = 'from', $content = 'content') {
+ $ret = <<<EOT
+ <{foreachq item={$item} from=${$from}}>
+ {$content}
+ <{/foreachq}>
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function getSmartySection
+ * @param string $name
+ * @param string $loop
+ * @param string $content
+ */
+ public function getSmartySection($name = 'name', $loop = 'loop', $content = 'content') {
+ $ret = <<<EOT
+ <{section name={$name} loop=${$loop}}>
+ {$content}
+ <{/section}>
+EOT;
+ return $ret;
+ }
+}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/admin/TemplatesAdminPages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/admin/TemplatesAdminPages.php 2014-12-04 21:57:19 UTC (rev 12887)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/admin/TemplatesAdminPages.php 2014-12-06 21:54:48 UTC (rev 12888)
@@ -113,7 +113,7 @@
switch( $fieldElement ) {
case 9:
$ret .= <<<EOT
- <td class="center"><span style="background-color: <{\$list.{$rpFieldName}}>;"> </span></td>\n
+ <td class="center"><span style="background-color: #<{\$list.{$rpFieldName}}>;"> </span></td>\n
EOT;
break;
case 10:
@@ -176,7 +176,7 @@
switch( $fieldElement ) {
case 9:
$ret .= <<<EOT
- <td class="center"><span style="background-color: <{\$list.{$fieldName}}>;">\t\t</span></td>\n
+ <td class="center"><span style="background-color: #<{\$list.{$fieldName}}>;">\t\t</span></td>\n
EOT;
break;
case 10:
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/blocks/TemplatesBlocks.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/blocks/TemplatesBlocks.php 2014-12-04 21:57:19 UTC (rev 12887)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/blocks/TemplatesBlocks.php 2014-12-06 21:54:48 UTC (rev 12888)
@@ -102,7 +102,7 @@
switch( $fieldElement ) {
case 9:
$ret .= <<<EOT
- <td class="center"><span style="background-color: <{\$list.{$rpFieldName}}>;">\t\t</span></td>\n
+ <td class="center"><span style="background-color: #<{\$list.{$rpFieldName}}>;">\t\t</span></td>\n
EOT;
break;
case 10:
@@ -156,7 +156,7 @@
switch( $fieldElement ) ...
[truncated message content] |
|
From: <txm...@us...> - 2015-01-24 14:14:39
|
Revision: 12947
http://sourceforge.net/p/xoops/svn/12947
Author: txmodxoops
Date: 2015-01-24 14:14:37 +0000 (Sat, 24 Jan 2015)
Log Message:
-----------
Updated
- Fixed bugs
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/css/admin/style.css
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/js/fields.js
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/include/IncludeFunctions.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/sql/mysql.sql
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/templates/admin/tdmcreate_fields.tpl
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/xoops_version.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/fields.php 2015-01-24 14:10:57 UTC (rev 12946)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/fields.php 2015-01-24 14:14:37 UTC (rev 12947)
@@ -22,15 +22,11 @@
// Recovered value of arguments op in the URL $
$op = XoopsRequest::getString('op', 'list');
// Get fields Variables
-/*$fieldMid = TDMCreate_CleanVars($_REQUEST, 'field_mid');
-$fieldTid = TDMCreate_CleanVars($_REQUEST, 'field_tid');
-$fieldNumb = TDMCreate_CleanVars($_REQUEST, 'field_numb');
-$fieldName = TDMCreate_CleanVars($_REQUEST, 'field_name', '', 'string');*/
$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':
@@ -51,7 +47,6 @@
$GLOBALS['xoopsTpl']->assign('tdmc_upload_imgtab_url', TDMC_UPLOAD_IMGTAB_URL);
$GLOBALS['xoopsTpl']->assign('modPathIcon16', $modPathIcon16);
$GLOBALS['xoopsTpl']->assign('sysPathIcon32', $sysPathIcon32);
- //var_dump($sysPathIcon32);
// Redirect if there aren't modules
$countModules = $tdmcreate->getHandler('modules')->getCount();
if ( $countModules == 0 ) {
@@ -104,6 +99,7 @@
{
$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');
@@ -124,6 +120,7 @@
$GLOBALS['xoopsTpl']->append('tables_list', $table);
unset($table);
}
+ unset($fields);
if ( $countTables > $limit ) {
include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
$pagenav = new XoopsPageNav($countTables, $limit, $start, 'start', 'op=list&limit=' . $limit);
@@ -131,11 +128,7 @@
}
} else {
$GLOBALS['xoopsTpl']->assign('error', _AM_TDMCREATE_THEREARENT_FIELDS);
- }
- /*var_dump($fieldMid);
- var_dump($fieldTid);
- var_dump($fieldNumb);
- var_dump($fieldName);*/
+ }
break;
case 'new':
@@ -150,12 +143,7 @@
// Form Add
$fieldsObj =& $tdmcreate->getHandler('fields')->create();
$form = $fieldsObj->getFormNew($fieldMid, $fieldTid, $fieldNumb, $fieldName);
- $GLOBALS['xoopsTpl']->assign('form', $form->render());
- // Test -> Will be removed
- /*var_dump($fieldMid);
- var_dump($fieldTid);
- var_dump($fieldNumb);
- var_dump($fieldName); */
+ $GLOBALS['xoopsTpl']->assign('form', $form->render());
break;
case 'save':
@@ -165,23 +153,22 @@
}
$fieldId = XoopsRequest::getInt('field_id');
// Fields Handler
- $fields = $tdmcreate->getHandler('fields');
+ $fields = $tdmcreate->getHandler('fields');
+ $orderId = 1;
// Set Variables
foreach($_POST['field_id'] as $key => $value)
{
- switch($value){
- case 'new':
- $fieldsObj =& $fields->create();
- break;
- default:
- $fieldsObj =& $fields->get($value);
- break;
+ if(isset($value)){
+ $fieldsObj =& $fields->get($value);
+ } else {
+ $fieldsObj =& $fields->create();
}
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] : $orderId) );
$fieldsObj->setVar( 'field_name', (isset($_POST['field_name'][$key]) ? $_POST['field_name'][$key] : '') );
$fieldsObj->setVar( 'field_type', (isset($_POST['field_type'][$key]) ? $_POST['field_type'][$key] : '') );
$fieldsObj->setVar( 'field_value', (isset($_POST['field_value'][$key]) ? $_POST['field_value'][$key] : '') );
@@ -202,7 +189,9 @@
// Insert Data
$tdmcreate->getHandler('fields')->insert($fieldsObj);
}
+ $orderId++;
}
+ unset($orderId);
// Get table name from field table id
$tables =& $tdmcreate->getHandler('tables')->get($fieldTid);
$table_name = $tables->getVar('table_name');
@@ -240,39 +229,19 @@
$fieldId = XoopsRequest::getInt('field_id');
$fieldsObj = $tdmcreate->getHandler('fields')->get( $fieldId );
$form = $fieldsObj->getFormEdit($fieldMid, $fieldTid);
- $GLOBALS['xoopsTpl']->assign('form', $form->render());
- // Test -> Will be removed
- //var_dump($fieldTid);
+ $GLOBALS['xoopsTpl']->assign('form', $form->render());
break;
-
- case 'drag':
- $side = TDMCreate_CleanVars( $_POST, 'field_id', 0, 'int' );
- $fieldId = XoopsRequest::getInt('field_id');
- if ( $fieldId > 0 ) {
- $fieldsObj = $tdmcreate->getHandler('fields')->get( $fieldId );
- $fieldsObj->setVar('field_id', $side);
- if (!$tdmcreate->getHandler('fields')->insert( $fieldsObj )) {
- redirect_header('fields.php', 5, _AM_TDMCREATE_FIELD_SIDE_ERROR);
- }
- }
- break;
-
+
case 'order':
- if ( isset($_POST['field_id'] ) ) {
- $i = 0;
- foreach($_POST['field_id'] as $order) {
- if( $order > 0 ) {
- $fieldsObj = $tdmcreate->getHandler('fields')->get( $order );
- $fieldsObj->setVar('field_id', $i);
- if (!$tdmcreate->getHandler('fields')->insert( $fieldsObj )) {
- redirect_header('fields.php', 5, _AM_TDMCREATE_FIELD_ORDER_ERROR);
- }
- $i++;
- }
- }
- unset($i);
- }
- exit;
+ foreach($_GET['fieldItem'] as $order => $id) {
+ if( $order > 0 ) {
+ $fieldsObj = $tdmcreate->getHandler('fields')->get( $id );
+ $fieldsObj->setVar('field_order', $order);
+ if (!$tdmcreate->getHandler('fields')->insert( $fieldsObj )) {
+ redirect_header('fields.php', 5, _AM_TDMCREATE_FIELD_ORDER_ERROR);
+ }
+ }
+ }
break;
case 'delete':
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/css/admin/style.css
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/css/admin/style.css 2015-01-24 14:10:57 UTC (rev 12946)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/css/admin/style.css 2015-01-24 14:14:37 UTC (rev 12947)
@@ -116,4 +116,37 @@
border: 1px dotted black;
margin: 0 0.1em 1em 0;
height: 50px;
+}
+
+#info {
+ display: block;
+ padding: 10px;
+ margin-bottom: 20px;
+ border: 1px solid #333;
+ background-color: #efefef;
+}
+
+.field-list tr { margin: 0; padding: 0; /*list-style: none;*/ }
+
+.field-list tr td { display: block; }
+
+.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;
+ color:#ff8400;
+}
+
+.field-list tr td img.move {
+ margin-right: 20px;
+ cursor: move;
+ vertical-align: middle;
+}
+.field-list tr td strong {
+ vertical-align: middle;
}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/js/fields.js
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/js/fields.js 2015-01-24 14:10:57 UTC (rev 12946)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/js/fields.js 2015-01-24 14:14:37 UTC (rev 12947)
@@ -1,5 +1,5 @@
// Jquery function for side fields
-$(document).ready( function() {
+/*$(document).ready( function() {
// Controls Drag & Drop
$('tbody tr.sortable td:nth-child(1) img').sortable({
update: function(event, ui) {
@@ -29,4 +29,14 @@
icon.closest( ".portlet" ).find( ".portlet-content" ).toggle();
});
}
-);
+);*/
+// Quando la pagina è caricata definisci l'ordine attuale e gli elementi da riordinare
+$(document).ready(function() {
+ $('.field-list').sortable({ //definisco il contenitore di elementi da riordinare
+ handle : '.move', //definisco con la classe .move quali sono gli elementi trascinabili
+ update : function () { //aggiorno l'ordine ed eseguo una callback
+ var order = $('.field-list').sortable('serialize'); // salvo una variabile che contiene l'array con il nuovo ordine degli elementi
+ $("#info").load("modules/tdmcreate/admin/fields.php?"+order);
+ }
+ });
+});
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/fields.php 2015-01-24 14:10:57 UTC (rev 12946)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/fields.php 2015-01-24 14:14:37 UTC (rev 12947)
@@ -20,6 +20,7 @@
*/
defined('XOOPS_ROOT_PATH') or die('Restricted access');
require_once 'html/TDMCreateFormLabel.php';
+require_once 'form/TDMCreateFormRadio.php';
require_once 'form/TDMCreateThemeForm.php';
/*
* @Class TDMCreateFields
@@ -42,7 +43,8 @@
$this->initVar('field_id', XOBJ_DTYPE_INT);
$this->initVar('field_mid', XOBJ_DTYPE_INT);
$this->initVar('field_tid', XOBJ_DTYPE_INT);
- $this->initVar('field_numb', XOBJ_DTYPE_INT);
+ $this->initVar('field_numb', XOBJ_DTYPE_INT);
+ $this->initVar('field_order', XOBJ_DTYPE_INT);
$this->initVar('field_name', XOBJ_DTYPE_TXTBOX);
$this->initVar('field_type', XOBJ_DTYPE_TXTBOX);
$this->initVar('field_value', XOBJ_DTYPE_TXTBOX);
@@ -146,13 +148,14 @@
$class = ($class == 'even') ? 'odd' : 'even';
// Replaced creation of new line by new function - goffy
$this->getFormNewLine($form, $class, $i, $field_mid, $field_tid, $f_name, $table_autoincrement);
+ //var_dump($i);
}
// Footer form
return $fields_form->getFooterForm($form);
}
/*
- * @public function getFormNewLine
+ * @private function getFormNewLine
*
* @param mixed $form
* @param mixed $class
@@ -164,9 +167,9 @@
*
* @author timgno - modified in getFormNewLine by goffy
*/
- public function getFormNewLine($form, $class, $i, $field_mid, $field_tid, $f_name, $table_autoincrement)
+ private function getFormNewLine($form, $class, $i, $field_mid, $field_tid, $f_name, $table_autoincrement)
{
- $form->addElement(new XoopsFormHidden('field_id['.$i.']', 'new'));
+ $form->addElement(new XoopsFormHidden('field_id['.$i.']', 0));
$form->addElement(new XoopsFormHidden('field_mid', $field_mid));
$form->addElement(new XoopsFormHidden('field_tid', $field_tid));
@@ -246,11 +249,11 @@
$field_block = 0;
$check_field_block = new XoopsFormCheckBox('', 'field_block['.$i.']', $field_block);
$check_field_block->addOption(1, _AM_TDMCREATE_FIELD_BLOCK);
- $parameters_tray->addElement($check_field_block);
-
- $field_main = ( $i == 1 ) ? 1 : 0;
- $check_field_main = new XoopsFormRadio('', 'field_main['.$i.']', $field_main);
- $check_field_main->addOption($i, _AM_TDMCREATE_FIELD_MAINFIELD );
+ $parameters_tray->addElement($check_field_block);
+
+ $main = ($table_autoincrement == 1) ? 2 : 1;
+ $check_field_main = new TDMCreateFormRadio('', 'field_main['.$i.']', $main);
+ $check_field_main->addOption($i, _AM_TDMCREATE_FIELD_MAINFIELD );
$parameters_tray->addElement($check_field_main);
$field_search = 0;
@@ -294,8 +297,9 @@
unset($criteria);
$id = 1;
foreach($fields as $field) {
- $class = ($class == 'even') ? 'odd' : 'even';
- $field_id = $field->getVar('field_id');
+ $main = $id;
+ $class = ($class == 'even') ? 'odd' : 'even';
+ $field_id = intval($field->getVar('field_id'));
if ($id>$table_nbfields) { //delete additional fields, if number of fields is reduced - goffy
$fieldsObj =& $this->tdmcreate->getHandler('fields')->get( $field_id );
$this->tdmcreate->getHandler('fields')->delete($fieldsObj, true);
@@ -309,28 +313,28 @@
// Index ID
$form->addElement(new TDMCreateFormLabel('<td class="center">'.$id.'</td>'));
// Field Name
- $field_name = new XoopsFormText(_AM_TDMCREATE_FIELD_NAME, 'field_name['.$field_id.']', 15, 255, $field->getVar('field_name'));
+ $field_name = new XoopsFormText(_AM_TDMCREATE_FIELD_NAME, 'field_name['.$id.']', 15, 255, $field->getVar('field_name'));
$form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_name->render().'</td>'));
// Field Type
- $fieldtype_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_TYPE, 'field_type['.$field_id.']', $field->getVar('field_type'));
+ $fieldtype_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_TYPE, 'field_type['.$id.']', $field->getVar('field_type'));
$fieldtype_select->addOptionArray($this->tdmcreate->getHandler('fieldtype')->getList());
$form->addElement(new TDMCreateFormLabel('<td class="center">'.$fieldtype_select->render().'</td>'));
// Field Value
- $field_value = new XoopsFormText(_AM_TDMCREATE_FIELD_VALUE, 'field_value['.$field_id.']', 5, 20, $field->getVar('field_value'));
+ $field_value = new XoopsFormText(_AM_TDMCREATE_FIELD_VALUE, 'field_value['.$id.']', 5, 20, $field->getVar('field_value'));
$form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_value->render().'</td>'));
// Field Attributes
- $field_attributes_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_TYPE, 'field_attribute['.$field_id.']', $field->getVar('field_attribute'));
+ $field_attributes_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_TYPE, 'field_attribute['.$id.']', $field->getVar('field_attribute'));
$field_attributes_select->addOptionArray($this->tdmcreate->getHandler('fieldattributes')->getList());
$form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_attributes_select->render().'</td>'));
// Field Null
- $field_null_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_NULL, 'field_null['.$field_id.']', $field->getVar('field_null'));
+ $field_null_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_NULL, 'field_null['.$id.']', $field->getVar('field_null'));
$field_null_select->addOptionArray($this->tdmcreate->getHandler('fieldnull')->getList());
$form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_null_select->render().'</td>'));
// Field Default
- $field_default = new XoopsFormText(_AM_TDMCREATE_FIELD_DEFAULT, 'field_default['.$field_id.']', 15, 25, $field->getVar('field_default'));
+ $field_default = new XoopsFormText(_AM_TDMCREATE_FIELD_DEFAULT, 'field_default['.$id.']', 15, 25, $field->getVar('field_default'));
$form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_default->render().'</td>'));
// Field Key
- $field_key_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_KEY, 'field_key['.$field_id.']', $field->getVar('field_key'));
+ $field_key_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_KEY, 'field_key['.$id.']', $field->getVar('field_key'));
$field_key_select->addOptionArray($this->tdmcreate->getHandler('fieldkey')->getList());
$form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_key_select->render().'</td>'));
// Field Void
@@ -345,59 +349,63 @@
$criteria_element->add(new Criteria('fieldelement_tid', 0));
$criteria_table = new CriteriaCompo();
$criteria_table->add(new Criteria('fieldelement_mid', $field_mid));
- $field_elements_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_ELEMENT_NAME, 'field_element['.$field_id.']', $field->getVar('field_element'));
+ $field_elements_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_ELEMENT_NAME, 'field_element['.$id.']', $field->getVar('field_element'));
$field_elements_select->addOptionArray($this->tdmcreate->getHandler('fieldelements')->getList($criteria_element));
$field_elements_select->addOptionArray($this->tdmcreate->getHandler('fieldelements')->getList($criteria_table));
unset($criteria_element); unset($criteria_table);
$parameters_tray->addElement($field_elements_select);
- $check_field_parent = new XoopsFormCheckBox(' ', 'field_parent['.$field_id.']', $field->getVar('field_parent'));
+ $check_field_parent = new XoopsFormCheckBox(' ', 'field_parent['.$id.']', $field->getVar('field_parent'));
$check_field_parent->addOption(1, _AM_TDMCREATE_FIELD_PARENT );
$parameters_tray->addElement($check_field_parent);
- $check_field_inlist = new XoopsFormCheckBox(' ', 'field_inlist['.$field_id.']', $field->getVar('field_inlist'));
+ $check_field_inlist = new XoopsFormCheckBox(' ', 'field_inlist['.$id.']', $field->getVar('field_inlist'));
$check_field_inlist->addOption(1, _AM_TDMCREATE_FIELD_INLIST);
$parameters_tray->addElement($check_field_inlist);
- $check_field_inform = new XoopsFormCheckBox(' ', 'field_inform['.$field_id.']', $field->getVar('field_inform'));
+ $check_field_inform = new XoopsFormCheckBox(' ', 'field_inform['.$id.']', $field->getVar('field_inform'));
$check_field_inform->addOption(1, _AM_TDMCREATE_FIELD_INFORM);
$parameters_tray->addElement($check_field_inform);
- $check_field_admin = new XoopsFormCheckBox(' ', 'field_admin['.$field_id.']', $field->getVar('field_admin'));
+ $check_field_admin = new XoopsFormCheckBox(' ', 'field_admin['.$id.']', $field->getVar('field_admin'));
$check_field_admin->addOption(1, _AM_TDMCREATE_FIELD_ADMIN);
$parameters_tray->addElement($check_field_admin);
- $check_field_user = new XoopsFormCheckBox(' ', 'field_user['.$field_id.']', $field->getVar('field_user'));
+ $check_field_user = new XoopsFormCheckBox(' ', 'field_user['.$id.']', $field->getVar('field_user'));
$check_field_user->addOption(1, _AM_TDMCREATE_FIELD_USER);
$parameters_tray->addElement($check_field_user);
- $check_field_block = new XoopsFormCheckBox('', 'field_block['.$field_id.']', $field->getVar('field_block'));
+ $check_field_block = new XoopsFormCheckBox('', 'field_block['.$id.']', $field->getVar('field_block'));
$check_field_block->addOption(1, _AM_TDMCREATE_FIELD_BLOCK);
$parameters_tray->addElement($check_field_block);
- $field_main = $field->getVar('field_main');
- $check_field_main = new XoopsFormRadio('', 'field_main['.$field_id.']', $field_main);
- $check_field_main->addOption($field_id, _AM_TDMCREATE_FIELD_MAINFIELD );
- $parameters_tray->addElement($check_field_main);
+ $field_main[$field_id] = $field->getVar('field_main');
+ $main_field = ($field_main[$field_id] == 1) ? $id : 1;
+ $check_field_main = new TDMCreateFormRadio('', 'field_main', $main_field);
+ $check_field_main->addOption($main, _AM_TDMCREATE_FIELD_MAINFIELD );
+ $parameters_tray->addElement($check_field_main);
- $check_field_search = new XoopsFormCheckBox(' ', 'field_search['.$field_id.']', $field->getVar('field_search'));
+ $check_field_search = new XoopsFormCheckBox(' ', 'field_search['.$id.']', $field->getVar('field_search'));
$check_field_search->addOption(1, _AM_TDMCREATE_FIELD_SEARCH);
$parameters_tray->addElement($check_field_search);
- $check_field_required = new XoopsFormCheckBox(' ', 'field_required['.$field_id.']', $field->getVar('field_required'));
+ $check_field_required = new XoopsFormCheckBox(' ', 'field_required['.$id.']', $field->getVar('field_required'));
$check_field_required->addOption(1, _AM_TDMCREATE_FIELD_REQUIRED);
$parameters_tray->addElement($check_field_required);
$form->addElement(new TDMCreateFormLabel('<td><div class="portlet"><div class="portlet-header">'._AM_TDMCREATE_FIELD_PARAMETERS_LIST.'</div><div class="portlet-content">'.$parameters_tray->render().'</div></div></td></tr>'));
}
$id++;
}
+ var_dump($main);
+ var_dump($id);
+ //var_dump($field_id);
}
// If you change number fields in tables,
// adding missing fields or delete unnecessary fields
// By goffy
for ($i = $id; $i <= $table_nbfields; $i++) {
$class = ($class == 'even') ? 'odd' : 'even';
- $this->getFormNewLine($form, $class, $i, $field_mid, $field_tid, $f_name, 0);
+ $this->getFormNewLine($form, $class, $i, $field_mid, $field_tid, $f_name, $table_autoincrement);
}
unset($id);
// Footer form
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/include/IncludeFunctions.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/include/IncludeFunctions.php 2015-01-24 14:10:57 UTC (rev 12946)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/include/IncludeFunctions.php 2015-01-24 14:14:37 UTC (rev 12947)
@@ -136,12 +136,143 @@
} else { // Compatibility for old Xoops versions
\$xoopsTpl->assign('xoops_meta_description', strip_tags(\$content));
}
+}\n
+EOT;
+ return $ret;
+ }
+
+ /*
+ * @public function getRewriteUrl
+ * @param string $moduleDirname
+ * @param string $tableName
+ */
+ public function getRewriteUrl($moduleDirname, $tableName) {
+ $ucfModuleDirname = ucfirst($moduleDirname);
+ $ret = <<<EOT
+\n/**
+ * Rewrite all url
+ *
+ * @String $module module name
+ * @String $array array
+ * @return $type string replacement for any blank case
+ */
+function {$moduleDirname}_RewriteUrl(\$module, \$array, \$type = 'content')
+{
+ \$comment = '';
+ \${$moduleDirname} = {$ucfModuleDirname}Helper::getInstance();
+ \${$tableName} = \${$moduleDirname}->getHandler('{$tableName}');
+ \$lenght_id = \${$moduleDirname}->getConfig('lenght_id');
+ \$rewrite_url = \${$moduleDirname}->getConfig('rewrite_url');
+
+ if (\$lenght_id != 0) {
+ \$id = \$array['content_id'];
+ while (strlen($id) < \$lenght_id)
+ \$id = "0" . $id;
+ } else {
+ \$id = \$array['content_id'];
+ }
+
+ if (isset(\$array['topic_alias']) && \$array['topic_alias']) {
+ \$topic_name = \$array['topic_alias'];
+ } else {
+ \$topic_name = {$moduleDirname}_Filter(xoops_getModuleOption('static_name', \$module));
+ }
+
+ switch (\$rewrite_url) {
+
+ case 'none':
+ if(\$topic_name) {
+ \$topic_name = 'topic=' . \$topic_name . '&';
+ }
+ \$rewrite_base = '/modules/';
+ \$page = 'page=' . \$array['content_alias'];
+ return XOOPS_URL . \$rewrite_base . \$module . '/' . \$type . '.php?' . \$topic_name . 'id=' . \$id . '&' . \$page . \$comment;
+ break;
+
+ case 'rewrite':
+ if(\$topic_name) {
+ \$topic_name = \$topic_name . '/';
+ }
+ \$rewrite_base = xoops_getModuleOption('rewrite_mode', \$module);
+ \$rewrite_ext = xoops_getModuleOption('rewrite_ext', \$module);
+ \$module_name = '';
+ if(xoops_getModuleOption('rewrite_name', \$module)) {
+ \$module_name = xoops_getModuleOption('rewrite_name', \$module) . '/';
+ }
+ \$page = \$array['content_alias'];
+ \$type = \$type . '/';
+ \$id = \$id . '/';
+ if (\$type == 'content/') \$type = '';
+
+ if (\$type == 'comment-edit/' || \$type == 'comment-reply/' || \$type == 'comment-delete/') {
+ return XOOPS_URL . \$rewrite_base . \$module_name . \$type . \$id . '/';
+ }
+
+ return XOOPS_URL . \$rewrite_base . \$module_name . \$type . \$topic_name . \$id . \$page . \$rewrite_ext;
+ break;
+
+ case 'short':
+ if(\$topic_name) {
+ \$topic_name = \$topic_name . '/';
+ }
+ \$rewrite_base = xoops_getModuleOption('rewrite_mode', \$module);
+ \$rewrite_ext = xoops_getModuleOption('rewrite_ext', \$module);
+ \$module_name = '';
+ if(xoops_getModuleOption('rewrite_name', \$module)) {
+ \$module_name = xoops_getModuleOption('rewrite_name', \$module) . '/';
+ }
+ \$page = \$array['content_alias'];
+ \$type = \$type . '/';
+ if (\$type == 'content/') \$type = '';
+
+ if (\$type == 'comment-edit/' || \$type == 'comment-reply/' || \$type == 'comment-delete/') {
+ return XOOPS_URL . \$rewrite_base . \$module_name . \$type . \$id . '/';
+ }
+
+ return XOOPS_URL . \$rewrite_base . \$module_name . \$type . \$topic_name . \$page . \$rewrite_ext;
+ break;
+ }
}
EOT;
return $ret;
}
/*
+ * @public function getRewriteFilter
+ * @param string $moduleDirname
+ * @param string $tableName
+ */
+ public function getRewriteFilter($moduleDirname, $tableName) {
+ $ucfModuleDirname = ucfirst($moduleDirname);
+ $ret = <<<EOT
+\n/**
+ * Replace all escape, character, ... for display a correct url
+ *
+ * @String $url string to transform
+ * @String $type string replacement for any blank case
+ * @return $url
+ */
+function {$moduleDirname}_Filter(\$url, \$type = '', \$module = '{$moduleDirname}') {
+
+ // Get regular expression from module setting. default setting is : `[^a-z0-9]`i
+ \${$moduleDirname} = {$ucfModuleDirname}Helper::getInstance();
+ \${$tableName} = \${$moduleDirname}->getHandler('{$tableName}');
+ \$regular_expression = \${$moduleDirname}->getConfig('regular_expression');
+
+ \$url = strip_tags(\$url);
+ \$url = preg_replace("`\[.*\]`U", "", \$url);
+ \$url = preg_replace('`&(amp;)?#?[a-z0-9]+;`i', '-', \$url);
+ \$url = htmlentities($url, ENT_COMPAT, 'utf-8');
+ \$url = preg_replace("`&([a-z])(acute|uml|circ|grave|ring|cedil|slash|tilde|caron|lig);`i", "\\1", \$url);
+ \$url = preg_replace(array($regular_expression, "`[-]+`"), "-", \$url);
+ \$url = (\$url == "") ? \$type : strtolower(trim(\$url, '-'));
+ return \$url;
+}
+EOT;
+ return $ret;
+ }
+
+ /*
* @public function render
* @param null
*/
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/sql/mysql.sql
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/sql/mysql.sql 2015-01-24 14:10:57 UTC (rev 12946)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/sql/mysql.sql 2015-01-24 14:14:37 UTC (rev 12947)
@@ -91,6 +91,7 @@
`field_mid` INT(5) UNSIGNED NOT NULL DEFAULT '0',
`field_tid` INT(5) UNSIGNED NOT NULL DEFAULT '0',
`field_numb` INT(10) UNSIGNED NOT NULL DEFAULT '0',
+ `field_order` INT(10) UNSIGNED NOT...
[truncated message content] |