You can subscribe to this list here.
| 2012 |
Jan
|
Feb
(214) |
Mar
(139) |
Apr
(198) |
May
(187) |
Jun
(151) |
Jul
(210) |
Aug
(169) |
Sep
(58) |
Oct
(53) |
Nov
(54) |
Dec
(301) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2013 |
Jan
(348) |
Feb
(178) |
Mar
(219) |
Apr
(154) |
May
(117) |
Jun
(194) |
Jul
(61) |
Aug
(132) |
Sep
(121) |
Oct
(110) |
Nov
(11) |
Dec
(18) |
| 2014 |
Jan
(34) |
Feb
(50) |
Mar
(82) |
Apr
(98) |
May
(39) |
Jun
(111) |
Jul
(67) |
Aug
(36) |
Sep
(33) |
Oct
(26) |
Nov
(53) |
Dec
(44) |
| 2015 |
Jan
(29) |
Feb
(47) |
Mar
(25) |
Apr
(19) |
May
(23) |
Jun
(20) |
Jul
(49) |
Aug
(7) |
Sep
(10) |
Oct
(10) |
Nov
(4) |
Dec
(25) |
| 2016 |
Jan
(8) |
Feb
(7) |
Mar
(1) |
Apr
|
May
(3) |
Jun
|
Jul
(1) |
Aug
(2) |
Sep
|
Oct
|
Nov
(7) |
Dec
(5) |
| 2017 |
Jan
(4) |
Feb
|
Mar
|
Apr
|
May
(15) |
Jun
|
Jul
(18) |
Aug
(24) |
Sep
|
Oct
(14) |
Nov
|
Dec
|
| 2018 |
Jan
|
Feb
(22) |
Mar
|
Apr
(11) |
May
(1) |
Jun
(17) |
Jul
(2) |
Aug
(2) |
Sep
|
Oct
(6) |
Nov
(5) |
Dec
|
| 2019 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
| 2025 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
|
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-09 13:47:09
|
Revision: 12691
http://sourceforge.net/p/xoops/svn/12691
Author: txmodxoops
Date: 2014-07-09 13:47:01 +0000 (Wed, 09 Jul 2014)
Log Message:
-----------
- Updated
- Still work to do
Modified Paths:
--------------
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/classes/formelements.php
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-09 07:54:43 UTC (rev 12690)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/objects.php 2014-07-09 13:47:01 UTC (rev 12691)
@@ -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-09 07:54:43 UTC (rev 12690)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/pages.php 2014-07-09 13:47:01 UTC (rev 12691)
@@ -116,31 +116,37 @@
foreach(array_keys($fields) as $f)
{
$fieldName = $fields[$f]->getVar('field_name');
- $rp_field_name = $fieldName;
- 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
- \${$lp_field_name}['{$rp_field_name}'] = \${$tableName}_arr[\$i]->getVar('{$fieldName}');\n
-EOT;
- }
+ $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));
+ }
+ }
+ $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
@@ -211,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);
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-09 07:54:43 UTC (rev 12690)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/classes/formelements.php 2014-07-09 13:47:01 UTC (rev 12691)
@@ -272,37 +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, $table, $fields, $required = 'false')
+ private function getXoopsFormTable($language, $moduleDirname, $tableName, $fields, $required = 'false')
{
- $tableId = $table->getVar('table_id');
- $tableName = $table->getVar('table_name');
$ucfTableName = ucfirst($tableName);
foreach(array_keys($fields) as $f)
{
if($fields[$f]->getVar('field_parent') == 1) {
$fieldName = $fields[$f]->getVar('field_name');
- }
- if($fields[$f]->getVar('field_element') > 12) {
- $criteriaElement = new CriteriaCompo();
- $criteriaElement->add(new Criteria('fieldelement_tid', $tableId));
- $fieldelement = $this->tdmcreate->getHandler('fieldelements')->getObjects($criteriaElement);
- unset($criteriaElement);
- foreach(array_keys($fieldelement) as $fe)
- {
- $fieldelementName = $fieldelement[$fe]->getVar('fieldelement_name');
- //$elementTableName = $tableName;
+ $field_element = $fields[$f]->getVar('field_element');
+ if($field_element > 12) {
+ $fieldelement = $this->tdmcreate->getHandler('fieldelements')->get($field_element);
+ $fieldelementName = $fieldelement->getVar('fieldelement_name');
+ $rpFieldelementName = strtolower(str_replace('Table : ', '', $fieldelementName));
}
}
}
$ret = <<<EOT
// Form Topic {$ucfTableName}
- \${$fieldelementName}Handler =& \$this->{$moduleDirname}->getHandler('{$fieldelementName}');
+ \${$rpFieldelementName}Handler =& \$this->{$moduleDirname}->getHandler('{$rpFieldelementName}');
\${$fieldName}_select = new XoopsFormSelect({$language}, '{$fieldName}', \$this->getVar('{$fieldName}'));
- \${$fieldName}_select->addOptionArray(\${$fieldelementName}Handler->getList());
+ \${$fieldName}_select->addOptionArray(\${$rpFieldelementName}Handler->getList());
\$form->addElement( \${$fieldName}_select{$required} );\n
EOT;
return $ret;
@@ -311,14 +304,14 @@
* @private function getXoopsFormTopic
* @param string $language
* @param string $moduleDirname
- * @param string $tableName
+ * @param string $table
* @param string $fields
* @param string $required
*/
private function getXoopsFormTopic($language, $moduleDirname, $table, $fields, $required = 'false')
{
$tableName = $table->getVar('table_name');
- $ucf_table_name = ucfirst($tableName);
+ $ucfTableName = ucfirst($tableName);
foreach(array_keys($fields) as $f)
{
$fieldName = $fields[$f]->getVar('field_name');
@@ -333,12 +326,12 @@
}
}
$ret = <<<EOT
- // Form Topic {$ucf_table_name}
- include_once(XOOPS_ROOT_PATH . '/class/tree.php');
- \${$tableName}Handler = \$this->{$moduleDirname}->getHandler('{$tableName}');
+ // Form Topic {$ucfTableName}
+ //\${$tableName}Handler = \$this->{$moduleDirname}->getHandler('{$tableName}');
\$criteria = new CriteriaCompo();
\${$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} );
@@ -418,7 +411,7 @@
if($table->getVar('table_category') == 1) {
$ret .= $this->getXoopsFormTopic($language, $moduleDirname, $table, $fields, $required);
} else {
- $ret .= $this->getXoopsFormTable($language, $moduleDirname, $table, $fields, $required);
+ $ret .= $this->getXoopsFormTable($language, $moduleDirname, $tableName, $fields, $required);
}
}
}
|
|
From: <txm...@us...> - 2014-07-09 07:55:00
|
Revision: 12690
http://sourceforge.net/p/xoops/svn/12690
Author: txmodxoops
Date: 2014-07-09 07:54:43 +0000 (Wed, 09 Jul 2014)
Log Message:
-----------
- Fixed bugs
- Updated
- Still work to do
Added Paths:
-----------
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/about.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/building.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/footer.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/header.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/index.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/menu.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/assets/
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/css/
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/css/admin/
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/css/admin/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/css/admin/style.css
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/css/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/css/style.css
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/empty.png
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/icons/
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/icons/16/
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/icons/16/arrow.gif
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/icons/16/blocks.png
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/icons/16/drag.png
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/icons/16/editfields.png
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/icons/16/fields.png
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/icons/16/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/icons/16/left_right.png
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/icons/16/spinner.gif
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/icons/16/submenu.png
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/icons/16/tables.png
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/icons/16/toggle.png
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/icons/32/
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/icons/32/addmodule.png
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/icons/32/addtable.png
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/icons/32/builder.png
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/icons/32/dashboard.png
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/icons/32/edittable.png
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/icons/32/fields.png
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/icons/32/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/icons/blank.gif
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/icons/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/icons/loading.gif
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/loading.gif
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/logo.png
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/logos/
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/logos/VeraBd.ttf
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/logos/empty.png
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/logos/green.png
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/logos/red.png
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/logos/xoops2.png
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/logos/xoopsdevelopmentteam_logo.gif
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/naked.png
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/xcvLogo.txt
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/js/
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/js/fields.js
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/js/functions.js
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/js/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/autoloader.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/building.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/fieldattributes.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/fieldelements.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/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/fieldtype.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/abstract.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/
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.html
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/
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/blocks/blocks.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/blocks/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/classes/
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/classes/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/css/
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/css/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/css/styles.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/docs/
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/docs/index.html
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/
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/index.html
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/
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/help.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/language/index.html
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/
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/sql/index.html
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/
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/admin/
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.html
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/
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/blocks/blocks.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/blocks/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/user/
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.html
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/
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.html
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
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/form/
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/form/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/form/themeform.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/helper.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/html/
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/html/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/html/simplelabel.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/logoGenerator.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/modules.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/session.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/docs/
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/docs/changelog.txt
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/docs/credits.txt
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/docs/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/docs/install.txt
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/docs/lang_diff.txt
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/docs/license.txt
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/docs/readme.txt
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/include/
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/include/common.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/include/functions.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/include/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/include/install.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/include/install_copy.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/include/update.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/language/
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/language/english/
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/language/english/admin.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/language/english/help/
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/language/english/help/help.html
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/language/english/help/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/language/english/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/language/english/modinfo.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/language/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/language/update language 1.0 to 1.1.txt
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/language/update language 1.1 to 1.15.txt
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/language/update language 1.1 to 1.37.txt
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/language/update language 1.15 to 1.37.txt
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/language/update language 1.37 to 1.38.txt
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/language/update language 1.38 to 1.39.txt
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/sql/
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/sql/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/sql/mysql.sql
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/templates/
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/templates/admin/
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/templates/admin/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/templates/admin/tdmcreate_about.tpl
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/templates/admin/tdmcreate_building.tpl
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/templates/admin/tdmcreate_fields.tpl
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/templates/admin/tdmcreate_footer.tpl
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/templates/admin/tdmcreate_header.tpl
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/templates/admin/tdmcreate_index.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/templates/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/xoops_version.php
Removed Paths:
-------------
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/
Added: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/about.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/about.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/about.php 2014-07-09 07:54:43 UTC (rev 12690)
@@ -0,0 +1,25 @@
+<?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: about.php 11084 2013-02-23 15:44:20Z timgno $
+ */
+include 'header.php';
+$template_main = 'tdmcreate_about.tpl';
+$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('about.php'));
+$GLOBALS['xoopsTpl']->assign('about', $adminMenu->renderAbout('6KJ7RW5DR3VTJ', false));
+include 'footer.php';
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/building.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/building.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/building.php 2014-07-09 07:54:43 UTC (rev 12690)
@@ -0,0 +1,97 @@
+<?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: building.php 12258 2014-01-02 09:33:29Z timgno $
+ */
+include 'header.php';
+$op = XoopsRequest::getString('op', 'default');
+$mid = XoopsRequest::getInt('mod_id');
+$moduleObj = $tdmcreate->getHandler('modules')->get( $mid );
+// Switch option
+switch ($op) {
+ case 'build':
+ $template_main = 'tdmcreate_building.tpl';
+ $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('building.php'));
+ // Get var module dirname
+ $moduleDirname = $moduleObj->getVar('mod_dirname');
+ // Directories for copy from to
+ $fromDir = TDMC_UPLOAD_REPOSITORY_PATH.'/'.strtolower($moduleDirname);
+ $toDir = XOOPS_ROOT_PATH.'/modules/'.strtolower($moduleDirname);
+ if(isset($moduleDirname)) {
+ // Clear this module if it's in repository
+ if(is_dir($fromDir)) {
+ TDMCreate_clearDir($fromDir);
+ }
+ // Clear this module if it's in root/modules
+ if(is_dir($toDir)) {
+ TDMCreate_clearDir($toDir);
+ }
+ }
+ // Structure
+ include_once TDMC_PATH . '/class/files/architecture.php';
+ $handler = TDMCreateArchitecture::getInstance();
+ $handler->getPath( TDMC_PATH );
+ $handler->getUploadPath( TDMC_UPLOAD_PATH );
+ // Creation of the structure of folders and files
+ $base_architecture = $handler->createBaseFoldersFiles( $moduleObj );
+ if($base_architecture !== false) {
+ $GLOBALS['xoopsTpl']->assign('base_architecture', true);
+ } else {
+ $GLOBALS['xoopsTpl']->assign('base_architecture', false);
+ }
+ // Get files
+ $build = array();
+ $files = $handler->createFilesToBuilding( $moduleObj );
+ foreach($files as $file) {
+ if($file) {
+ $build['list'] = $file;
+ }
+ $GLOBALS['xoopsTpl']->append('builds', $build);
+ }
+ unset($build);
+ // Directory to saved all files
+ $GLOBALS['xoopsTpl']->assign('building_directory', sprintf(_AM_TDMCREATE_BUILDING_DIRECTORY, $moduleDirname));
+ // Copy this module in root modules
+ if( $moduleObj->getVar('mod_inroot_copy') == 1 ) {
+ TDMCreate_copyr($fromDir, $toDir);
+ }
+ break;
+
+ case 'default':
+ default:
+ $template_main = 'tdmcreate_building.tpl';
+ $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('building.php'));
+ // Redirect if there aren't modules
+ $nbModules = $tdmcreate->getHandler('modules')->getCount();
+ if( $nbModules == 0 ) {
+ redirect_header('modules.php?op=new', 2, _AM_TDMCREATE_NOTMODULES );
+ }
+ unset($nbModules);
+ // Redirect if there aren't tables
+ $nbTables = $tdmcreate->getHandler('tables')->getCount();
+ if($nbTables == 0) {
+ redirect_header('tables.php?op=new', 2, _AM_TDMCREATE_NOTTABLES );
+ }
+ unset($nbTables);
+ include_once TDMC_PATH . '/class/building.php';
+ $handler = TDMCreateBuilding::getInstance();
+ $form = $handler->getForm();
+ $GLOBALS['xoopsTpl']->assign('form', $form->render());
+ break;
+}
+include 'footer.php';
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/fields.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/fields.php 2014-07-09 07:54:43 UTC (rev 12690)
@@ -0,0 +1,330 @@
+<?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 fields.php 12258 2014-01-02 09:33:29Z timgno $
+ */
+include 'header.php';
+// Recovered value of arguments op in the URL $
+$op = XoopsRequest::getString('op', 'list');
+// Get fields Variables
+$field_mid = 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');
+$fieldTid = XoopsRequest::getInt('field_tid');
+$fieldNumb = XoopsRequest::getInt('field_numb');
+$fieldName = XoopsRequest::getString('field_name', ''); */
+//
+switch ($op)
+{
+ case 'list':
+ default:
+ $start = XoopsRequest::getInt('start', 0);
+ $limit = XoopsRequest::getInt('limit', $tdmcreate->getConfig('tables_adminpager'));
+ // Define main template
+ $template_main = 'tdmcreate_fields.tpl';
+ $GLOBALS['xoTheme']->addStylesheet( 'modules/TDMCreate/assets/css/admin/style.css' );
+ $GLOBALS['xoTheme']->addScript('modules/TDMCreate/assets/js/functions.js');
+ $GLOBALS['xoTheme']->addScript('modules/TDMCreate/assets/js/fields.js');
+ $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('fields.php'));
+ $adminMenu->addItemButton(_AM_TDMCREATE_ADD_TABLE, 'tables.php?op=new', 'add');
+ $GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
+ $GLOBALS['xoopsTpl']->assign('tdmc_url', TDMC_URL);
+ $GLOBALS['xoopsTpl']->assign('tdmc_icons_url', TDMC_ICONS_URL);
+ $GLOBALS['xoopsTpl']->assign('tdmc_upload_url', TDMC_UPLOAD_URL);
+ $GLOBALS['xoopsTpl']->assign('tdmc_upload_imgtab_url', TDMC_UPLOAD_IMGTAB_URL);
+ $GLOBALS['xoopsTpl']->assign('modPathIcon16', $modPathIcon16);
+ $GLOBALS['xoopsTpl']->assign('sysPathIcon32', $sysPathIcon32);
+ //var_dump($sysPathIcon32);
+ // Redirect if there aren't modules
+ $nb_modules = $tdmcreate->getHandler('modules')->getCount();
+ if ( $nb_modules == 0 ) {
+ redirect_header('modules.php?op=new', 2, _AM_TDMCREATE_NOTMODULES );
+ }
+ unset($nb_modules);
+ // Redirect if there aren't tables
+ $nb_tables = $tdmcreate->getHandler('tables')->getCount();
+ if ($nb_tables == 0) {
+ redirect_header('tables.php?op=new', 2, _AM_TDMCREATE_NOTTABLES );
+ }
+ unset($nb_tables);
+ // 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);
+ unset($criteria);
+ if ($nb_tables > 0)
+ {
+ foreach (array_keys($tables_arr) 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');
+ // Get the list of fields
+ $criteria = new CriteriaCompo();
+ $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);
+ unset($criteria);
+ // Display fields list
+ $fields = array();
+ $lid = 1;
+ if ( $nb_fields > 0 )
+ {
+ foreach (array_keys($fields_arr) 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');
+ $fields[] = $field;
+ unset($field);
+ $lid++;
+ }
+ }
+ unset($lid);
+ $table['fields'] = $fields;
+ $GLOBALS['xoopsTpl']->append('tables_list', $table);
+ unset($table);
+ }
+ if ( $nb_tables > $limit ) {
+ include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
+ $pagenav = new XoopsPageNav($nb_tables, $limit, $start, 'start', 'op=list&limit=' . $limit);
+ $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4));
+ }
+ } else {
+ $GLOBALS['xoopsTpl']->assign('error', _AM_TDMCREATE_THEREARENT_FIELDS);
+ }
+ break;
+
+ case 'new':
+ // Define main template
+ $template_main = 'tdmcreate_fields.tpl';
+ $GLOBALS['xoTheme']->addStylesheet( 'modules/TDMCreate/assets/css/admin/style.css' );
+ $GLOBALS['xoTheme']->addScript('modules/TDMCreate/assets/js/fields.js');
+ $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('fields.php'));
+ $adminMenu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php', 'list');
+ $adminMenu->addItemButton(_AM_TDMCREATE_FIELDS_LIST, 'fields.php', 'list');
+ $GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
+ // Form Add
+ $fieldsObj =& $tdmcreate->getHandler('fields')->create();
+ $form = $fieldsObj->getFormNew($field_mid, $fieldTid, $fieldNumb, $fieldName);
+ $GLOBALS['xoopsTpl']->assign('form', $form->render());
+ // Test -> Will be removed
+ var_dump($field_mid);
+ var_dump($fieldTid);
+ var_dump($fieldNumb);
+ var_dump($fieldName);
+ break;
+
+ case 'save':
+ //
+ if ( !$GLOBALS['xoopsSecurity']->check() ) {
+ redirect_header('fields.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
+ }
+ $fieldId = XoopsRequest::getInt('field_id');
+ // Fields Handler
+ $fields = $tdmcreate->getHandler('fields');
+ // 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($field_mid) && isset($fieldTid) && !empty($_POST['field_name'][$key])) {
+ // Set Data
+ $fieldsObj->setVar( 'field_mid', $field_mid );
+ $fieldsObj->setVar( 'field_tid', $fieldTid );
+ $fieldsObj->setVar( 'field_numb', $fieldNumb );
+ $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] : '') );
+ $fieldsObj->setVar( 'field_attribute', (isset($_POST['field_attribute'][$key]) ? $_POST['field_attribute'][$key] : '') );
+ $fieldsObj->setVar( 'field_null', (isset($_POST['field_null'][$key]) ? $_POST['field_null'][$key] : '') );
+ $fieldsObj->setVar( 'field_default', (isset($_POST['field_default'][$key]) ? $_POST['field_default'][$key] : '') );
+ $fieldsObj->setVar( 'field_key', (isset($_POST['field_key'][$key]) ? $_POST['field_key'][$key] : '') );
+ $fieldsObj->setVar( 'field_element', (isset($_POST['field_element'][$key]) ? $_POST['field_element'][$key] : '') );
+ $fieldsObj->setVar( 'field_parent', ((isset($_REQUEST['field_parent'][$key]) == 1) ? 1 : 0) );
+ $fieldsObj->setVar( 'field_inlist', ((isset($_REQUEST['field_inlist'][$key]) == 1) ? 1 : 0) );
+ $fieldsObj->setVar( 'field_inform', ((isset($_REQUEST['field_inform'][$key]) == 1) ? 1 : 0) );
+ $fieldsObj->setVar( 'field_admin', ((isset($_REQUEST['field_admin'][$key]) == 1) ? 1 : 0) );
+ $fieldsObj->setVar( 'field_user', ((isset($_REQUEST['field_user'][$key]) == 1) ? 1 : 0) );
+ $fieldsObj->setVar( 'field_block', ((isset($_REQUEST['field_block'][$key]) == 1) ? 1 : 0) );
+ $fieldsObj->setVar( 'field_main', (($key == isset($_REQUEST['field_main'][$key])) ? 1 : 0) );
+ $fieldsObj->setVar( 'field_search', ((isset($_REQUEST['field_search'][$key]) == 1) ? 1 : 0) );
+ $fieldsObj->setVar( 'field_required', ((isset($_REQUEST['field_required'][$key]) == 1) ? 1 : 0) );
+ // Insert Data
+ $tdmcreate->getHandler('fields')->insert($fieldsObj);
+ }
+ }
+ // Get table name from field table id
+ $tables =& $tdmcreate->getHandler('tables')->get($fieldTid);
+ $table_name = $tables->getVar('table_name');
+ // Set field elements
+ if ($fieldsObj->isNew()) {
+ // Fields Elements Handler
+ $fieldelementObj =& $tdmcreate->getHandler('fieldelements')->create();
+ $fieldelementObj->setVar( 'fieldelement_mid', $field_mid );
+ $fieldelementObj->setVar( 'fieldelement_tid', $fieldTid );
+ $fieldelementObj->setVar( 'fieldelement_name', 'Table : '.ucfirst($table_name) );
+ $fieldelementObj->setVar( 'fieldelement_value', 'XoopsFormTables-'.ucfirst($table_name) );
+ // Insert new field element id for table name
+ if (!$tdmcreate->getHandler('fieldelements')->insert($fieldelementObj) ) {
+ $GLOBALS['xoopsTpl']->assign('error', $fieldelementObj->getHtmlErrors() . ' Field element');
+ }
+ redirect_header('fields.php', 2, sprintf(_AM_TDMCREATE_FIELDS_FORM_SAVED_OK, $table_name));
+ } else {
+ redirect_header('fields.php', 2, sprintf(_AM_TDMCREATE_FIELDS_FORM_UPDATED_OK, $table_name));
+ }
+ //
+ $GLOBALS['xoopsTpl']->assign('error', $fieldsObj->getHtmlErrors());
+ $form = $fieldsObj->getForm(null, $fieldTid);
+ $GLOBALS['xoopsTpl']->assign('form', $form->render());
+ break;
+
+ case 'edit':
+ // Define main template
+ $template_main = 'tdmcreate_fields.tpl';
+ $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('fields.php'));
+ $adminMenu->addItemButton(_AM_TDMCREATE_ADD_TABLE, 'tables.php?op=new', 'add');
+ $adminMenu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php', 'list');
+ $adminMenu->addItemButton(_AM_TDMCREATE_FIELDS_LIST, 'fields.php', 'list');
+ $GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
+ // Form Edit
+ $fieldId = XoopsRequest::getInt('field_id');
+ $fieldsObj = $tdmcreate->getHandler('fields')->get( $fieldId );
+ $form = $fieldsObj->getFormEdit($field_mid, $fieldTid);
+ $GLOBALS['xoopsTpl']->assign('form', $form->render());
+ // Test -> Will be removed
+ var_dump($fieldTid);
+ 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;
+ 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);
+ }
+ }
+ break;
+}
+include 'footer.php';
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/footer.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/footer.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/footer.php 2014-07-09 07:54:43 UTC (rev 12690)
@@ -0,0 +1,26 @@
+<?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: footer.php 12207 2013-10-23 02:46:52Z beckmi $
+ */
+$GLOBALS['xoopsTpl']->assign('module_name', $GLOBALS['xoopsModule']->getVar('name'));
+if ( isset($template_main) ) {
+ $GLOBALS['xoopsTpl']->display("db:{$template_main}");
+}
+xoops_cp_footer();
+?>
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/header.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/header.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/header.php 2014-07-09 07:54:43 UTC (rev 12690)
@@ -0,0 +1,57 @@
+<?php
+/*
+ You may not change or alter any portion of this comment or credits
+ of supporting developers from this source code or any supporting source code
+ which is considered copyrighted (c) material of the original comment or credit authors.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+/**
+ * tdmcreate module
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package tdmcreate
+ * @since 2.5.0
+ * @author Txmod Xoops http://www.txmodxoops.org
+ * @version $Id: header.php 12258 2014-01-02 09:33:29Z timgno $
+*/
+include_once dirname(dirname(dirname(dirname(__FILE__)))) . '/include/cp_header.php';
+include_once dirname(dirname(__FILE__)) . '/include/common.php';
+//
+$thisDirname = $GLOBALS['xoopsModule']->getVar('dirname');
+// Link System Icons
+$sysPathIcon16 = $GLOBALS['xoopsModule']->getInfo('sysicons16');
+$sysPathIcon32 = $GLOBALS['xoopsModule']->getInfo('sysicons32');
+// Link Local Icons
+$modPathIcon16 = $GLOBALS['xoopsModule']->getInfo('modicons16');
+$modPathIcon32 = $GLOBALS['xoopsModule']->getInfo('modicons32');
+$pathModuleAdmin = $GLOBALS['xoopsModule']->getInfo('dirmoduleadmin');
+// TDMCreate Instance
+$tdmcreate = TDMCreate::getInstance();
+// MyTextSanitizer
+$myts =& MyTextSanitizer::getInstance();
+if (!isset($xoopsTpl) || !is_object($xoopsTpl)) {
+ include_once(XOOPS_ROOT_PATH."/class/template.php");
+ $xoopsTpl = new XoopsTpl();
+}
+// System Icons
+$GLOBALS['xoopsTpl']->assign('sysPathIcon16', $sysPathIcon16);
+$GLOBALS['xoopsTpl']->assign('sysPathIcon32', $sysPathIcon32);
+// Local Icons
+$GLOBALS['xoopsTpl']->assign('modPathIcon16', $modPathIcon16);
+$GLOBALS['xoopsTpl']->assign('modPathIcon32', $modPathIcon32);
+// Load languages
+xoops_loadLanguage('admin', $thisDirname);
+xoops_loadLanguage('modinfo', $thisDirname);
+xoops_loadLanguage('main', $thisDirname);
+// Locad admin menu class
+if ( file_exists($GLOBALS['xoops']->path($pathModuleAdmin.'/moduleadmin.php'))){
+ include_once $GLOBALS['xoops']->path($pathModuleAdmin.'/moduleadmin.php');
+}else{
+ redirect_header("../../../admin.php", 5, _AM_MODULEADMIN_MISSING, false);
+}
+xoops_cp_header();
+$adminMenu = new ModuleAdmin();
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/index.html
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/index.html (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/index.html 2014-07-09 07:54:43 UTC (rev 12690)
@@ -0,0 +1 @@
+ <script>history.go(-1);</script>
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/index.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/index.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/index.php 2014-07-09 07:54:43 UTC (rev 12690)
@@ -0,0 +1,35 @@
+<?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: index.php 11084 2013-02-23 15:44:20Z timgno $
+ */
+include 'header.php';
+$criteria = new CriteriaCompo();
+$count_modules = $tdmcreate->getHandler('modules')->getCount($criteria);
+$count_tables = $tdmcreate->getHandler('tables')->getCount($criteria);
+$count_fields = $tdmcreate->getHandler('fields')->getCount($criteria);
+unset($criteria);
+$template_main = 'tdmcreate_index.tpl';
+$adminMenu->addInfoBox(_AM_TDMCREATE_ADMIN_NUMMODULES) ;
+$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, '<label>' ._AM_TDMCREATE_THEREARE_NUMMODULES. '</label>', $count_modules, 'Green') ;
+$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, '<label>' ._AM_TDMCREATE_THEREARE_NUMTABLES. '</label>', $count_tables, 'Orange');
+$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, '<label>' ._AM_TDMCREATE_THEREARE_NUMFIELDS. '</label>', $count_fields, 'Gray');
+//$xoopsOption['template_main'] = 'tdmcreate_index.html';
+$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('index.php'));
+$GLOBALS['xoopsTpl']->assign('index', $adminMenu->renderIndex());
+include 'footer.php';
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/menu.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/menu.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/menu.php 2014-07-09 07:54:43 UTC (rev 12690)
@@ -0,0 +1,50 @@
+<?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: menu.php 11084 2013-02-23 15:44:20Z timgno $
+ */
+$module_handler =& xoops_gethandler('module');
+$xoopsModule =& XoopsModule::getByDirname('TDMCreate');
+$moduleInfo =& $module_handler->get($xoopsModule->getVar('mid'));
+$sysPathIcon32 = $moduleInfo->getInfo('sysicons32');
+$adminmenu = array();
+$i = 1;
+$adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU1;
+$adminmenu[$i]['link'] = 'admin/index.php';
+$adminmenu[$i]['icon'] = $sysPathIcon32.'/dashboard.png';
+$i++;
+$adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU2;
+$adminmenu[$i]['link'] = 'admin/modules.php';
+$adminmenu[$i]['icon'] = 'assets/images/icons/32/addmodule.png';
+$i++;
+$adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU3;
+$adminmenu[$i]['link'] = 'admin/tables.php';
+$adminmenu[$i]['icon'] = 'assets/images/icons/32/addtable.png';
+$i++;
+$adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU4;
+$adminmenu[$i]['link'] = 'admin/fields.php';
+$adminmenu[$i]['icon'] = 'assets/images/icons/32/fields.png';
+$i++;
+$adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU5;
+$adminmenu[$i]['link'] = 'admin/building.php';
+$adminmenu[$i]['icon'] = 'assets/images/icons/32/builder.png';
+$i++;
+$adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU6;
+$adminmenu[$i]['link'] = 'admin/about.php';
+$adminmenu[$i]['icon'] = $sysPathIcon32.'/about.png';
+unset($i);
Added: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/modules.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/modules.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/modules.php 2014-07-09 07:54:43 UTC (rev 12690)
@@ -0,0 +1,238 @@
+<?php
+/*
+ You may not change or alter any portion of this comment or credits
+ of supporting developers from this source code or any supporting source code
+ which is considered copyrighted (c) material of the original comment or credit authors.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+/**
+ * tdmcreate module
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package tdmcreate
+ * @since 2.5.5
+ * @author Txmod Xoops <su...@tx...>
+ * @version $Id: 1.59 modules.php 11297 2013-03-24 10:58:10Z timgno $
+ */
+include 'header.php';
+// Recovered value of argument op in the URL $
+$op = XoopsRequest::getString('op', 'list');
+//
+$mod_id = XoopsRequest::getInt('mod_id');
+//
+switch ($op)
+{
+ case 'list':
+ default:
+ $start = XoopsRequest::getInt('start', 0);
+ $limit = XoopsRequest::getInt('limit', $tdmcreate->getConfig('modules_adminpager'));
+ // Define main template
+ $template_main = 'tdmcreate_modules.tpl';
+ $GLOBALS['xoTheme']->addScript('modules/TDMCreate/assets/js/functions.js');
+ $GLOBALS['xoTheme']->addStylesheet( 'modules/TDMCreate/assets/css/admin/style.css' );
+ $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('modules.php'));
+ $adminMenu->addItemButton(_AM_TDMCREATE_ADD_MODULE, 'modules.php?op=new', 'add');
+ $GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
+ $GLOBALS['xoopsTpl']->assign('tdmc_url', TDMC_URL);
+ $GLOBALS['xoopsTpl']->assign('tdmc_upload_imgmod_url', TDMC_UPLOAD_IMGMOD_URL);
+ $GLOBALS['xoopsTpl']->assign('modPathIcon16', $modPathIcon16);
+ $GLOBALS['xoopsTpl']->assign('sysPathIcon32', $sysPathIcon32);
+ $criteria = new CriteriaCompo();
+ $criteria->setSort('mod_id ASC, mod_name');
+ $criteria->setOrder('ASC');
+ $nb_modules = $tdmcreate->getHandler('modules')->getCount( $criteria );
+ $mods_arr = $tdmcreate->getHandler('modules')->getAll( $criteria );
+ unset($criteria);
+ // Redirect if there aren't modules
+ if ( $nb_modules == 0 ) {
+ redirect_header('modules.php?op=new', 2, _AM_TDMCREATE_NOTMODULES );
+ }
+ // Display modules list
+ if ( $nb_modules > 0 ) {
+ foreach (array_keys($mods_arr) as $i) {
+ $mod['id'] = $i;
+ $mod['name'] = $mods_arr[$i]->getVar('mod_name');
+ $mod['version'] = $mods_arr[$i]->getVar('mod_version');
+ $mod['image'] = $mods_arr[$i]->getVar('mod_image');
+ $mod['release'] = $mods_arr[$i]->getVar('mod_release');
+ $mod['status'] = $mods_arr[$i]->getVar('mod_status');
+ $mod['admin'] = $mods_arr[$i]->getVar('mod_admin');
+ $mod['user'] = $mods_arr[$i]->getVar('mod_user');
+ $mod['search'] = $mods_arr[$i]->getVar('mod_search');
+ $mod['comments'] = $mods_arr[$i]->getVar('mod_comments');
+ $mod['notifications'] = $mods_arr[$i]->getVar('mod_notifications');
+ $mod['permissions'] = $mods_arr[$i]->getVar('mod_permissions');
+ $GLOBALS['xoopsTpl']->append('modules_list', $mod);
+ unset($mod);
+ }
+ if ( $nb_modules > $limit ) {
+ include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
+ $pagenav = new XoopsPageNav($nb_modules, $limit, $start, 'start', 'op=list&limit=' . $limit);
+ $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4));
+ }
+ } else {
+ $GLOBALS['xoopsTpl']->assign('error', _AM_TDMCREATE_THEREARENT_MODULES);
+ }
+ break;
+
+ case 'new':
+ // Define main template
+ $template_main = 'tdmcreate_modules.tpl';
+ $GLOBALS['xoTheme']->addScript('modules/TDMCreate/assets/js/functions.js');
+ $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('modules.php'));
+ $adminMenu->addItemButton(_AM_TDMCREATE_MODULES_LIST, 'modules.php', 'list');
+ $GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
+
+ $modulesObj =& $tdmcreate->getHandler('modules')->create();
+ $form = $modulesObj->getForm();
+ $GLOBALS['xoopsTpl']->assign('form', $form->render());
+ break;
+
+ case 'save':
+ if ( !$GLOBALS['xoopsSecurity']->check() ) {
+ redirect_header('modules.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
+ }
+ if (isset($mod_id)) {
+ $modulesObj =& $tdmcreate->getHandler('modules')->get($mod_id);
+ } else {
+ $modulesObj =& $tdmcreate->getHandler('modules')->create();
+ }
+ $moduleDirname = preg_replace('/[^a-zA-Z0-9]\s+/', '', strtolower($_POST['mod_dirname']));
+ //Form module save
+ $modulesObj->setVars(array('mod_name' => $_POST['mod_name'],
+ 'mod_dirname' => $moduleDirname,
+ 'mod_version' => $_POST['mod_version'],
+ 'mod_since' => $_POST['mod_since'],
+ 'mod_min_php' => $_POST['mod_min_php'],
+ 'mod_min_xoops' => $_POST['mod_min_xoops'],
+ 'mod_min_admin' => $_POST['mod_min_admin'],
+ 'mod_min_mysql' => $_POST['mod_min_mysql'],
+ 'mod_description' => $_POST['mod_description'],
+ 'mod_author' => $_POST['mod_author'],
+ 'mod_author_mail' => $_POST['mod_author_mail'],
+ 'mod_author_website_url' => $_POST['mod_author_website_url'],
+ 'mod_author_website_name' => $_POST['mod_author_website_name'],
+ 'mod_credits' => $_POST['mod_credits'],
+ 'mod_license' => $_POST['mod_license'],
+ 'mod_release_info' => $_POST['mod_release_info'],
+ 'mod_release_file' => $_POST['mod_release_file'],
+ 'mod_manual' => $_POST['mod_manual'],
+ 'mod_manual_file' => $_POST['mod_manual_file']));
+ //Form mod_image
+ include_once XOOPS_ROOT_PATH . '/class/uploader.php';
+ $uploader = new XoopsMediaUploader(TDMC_UPLOAD_IMGMOD_PATH, $tdmcreate->getConfig('mimetypes'),
+ $tdmcreate->getConfig('maxsize'), null, null);
+ if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) {
+ /*$extension = preg_replace( '/.*\.([^.]+)$/', '\\1', $_FILES['attachedfile']['name']);
+ $logo_image = $moduleDirname.'_slogo.'.$extension;
+ $uploader->setPrefix($logo_image);*/
+ $uploader->fetchMedia($_POST['xoops_upload_file'][0]);
+ if (!$uploader->upload()) {
+ $errors = $uploader->getErrors();
+ redirect_header('javascript:history.go(-1)',3, $errors);
+ } else {
+ $modulesObj->setVar('mod_image', $uploader->getSavedFileName());
+ }
+ } else {
+ $modulesObj->setVar('mod_image', $_POST['mod_image']);
+ }
+ //Form module save
+ $modulesObj->setVars(array('mod_demo_site_url' => $_POST['mod_demo_site_url'],
+ 'mod_demo_site_name' => $_POST['mod_demo_site_name'],
+ 'mod_support_url' => $_POST['mod_support_url'],
+ 'mod_support_name' => $_POST['mod_support_name'],
+ 'mod_website_url' => $_POST['mod_website_url'],
+ 'mod_website_name' => $_POST['mod_website_name'],
+ 'mod_release' => $_POST['mod_release'],
+ 'mod_status' => $_POST['mod_status'],
+ 'mod_admin' => (($_REQUEST['mod_admin'] == 1) ? '1' : '0'),
+ 'mod_user' => (($_REQUEST['mod_user'] == 1) ? '1' : '0'),
+ 'mod_blocks' => (($_REQUEST['mod_blocks'] == 1) ? '1' : '0'),
+ 'mod_search' => (($_REQUEST['mod_search'] == 1) ? '1' : '0'),
+ 'mod_comments' => (($_REQUEST['mod_comments'] == 1) ? '1' : '0'),
+ 'mod_notifications' => (($_REQUEST['mod_notifications'] == 1) ? '1' : '0'),
+ 'mod_permissions' => (($_REQUEST['mod_permissions'] == 1) ? '1' : '0'),
+ 'mod_inroot_copy' => (($_REQUEST['mod_inroot_copy'] == 1) ? '1' : '0'),
+ 'mod_donations' => $_POST['mod_donations'],
+ 'mod_subversion' => $_POST['mod_subversion'])
+ );
+
+ if ($tdmcreate->getHandler('modules')->insert($modulesObj)) {
+ if( $modulesObj->isNew() ) {
+ redirect_header('modules.php', 5, sprintf(_AM_TDMCREATE_MODULE_FORM_CREATED_OK, $_POST['mod_name']));
+ } else {
+ redirect_header('modules.php', 5, sprintf(_AM_TDMCREATE_MODULE_FORM_UPDATED_OK, $_POST['mod_name']));
+ }
+ }
+
+ $GLOBALS['xoopsTpl']->assign('error', $modulesObj->getHtmlErrors());
+ $form =& $modulesObj->getForm();
+ $GLOBALS['xoopsTpl']->assign('form', $form->render());
+ break;
+
+ case 'edit':
+ // Define main template
+ $template_main = 'tdmcreate_modules.tpl';
+ $GLOBALS['xoTheme']->addScript('modules/TDMCreate/assets/js/functions.js');
+ $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('modules.php'));
+ $adminMenu->addItemButton(_AM_TDMCREATE_ADD_MODULE, 'modules.php?op=new', 'add');
+ $adminMenu->addItemButton(_AM_TDMCREATE_MODULES_LIST, 'modules.php', 'list');
+ $GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
+
+ $modulesObj = $tdmcreate->getHandler('modules')->get($mod_id);
+ $form = $modulesObj->getForm();
+ $GLOBALS['xoopsTpl']->assign('form', $form->render());
+ break;
+
+ case 'delete':
+ $modulesObj =& $tdmcreate->getHandler('modules')->get($mod_id);
+ if (isset($_REQUEST['ok']) && $_REQUEST['ok'] == 1) {
+ if ( !$GLOBALS['xoopsSecurity']->check() ) {
+ redirect_header('modules.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
+ }
+ if ($tdmcreate->getHandler('modules')->delete($modulesObj)) {
+ redirect_header('modules.php', 3, _AM_TDMCREATE_FORMDELOK);
+ } else {
+ $GLOBALS['xoopsTpl']->assign('error', $modulesObj->getHtmlErrors());
+ }
+ } else {
+ xoops_confirm(array('ok' => 1, 'mod_id' => $mod_id, 'op' => 'delete'), $_SERVER['REQUEST_URI'], sprintf(_AM_TDMCREATE_FORMSUREDEL, $modulesO...
[truncated message content] |
|
From: <txm...@us...> - 2014-07-09 06:31:43
|
Revision: 12689
http://sourceforge.net/p/xoops/svn/12689
Author: txmodxoops
Date: 2014-07-09 06:31:40 +0000 (Wed, 09 Jul 2014)
Log Message:
-----------
Property Changed:
----------------
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/
Index: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate 2014-07-08 23:09:11 UTC (rev 12688)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate 2014-07-09 06:31:40 UTC (rev 12689)
Property changes on: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate
___________________________________________________________________
Added: svn:mergeinfo
## -0,0 +1 ##
+/XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate:12685-12687
\ No newline at end of property
|
|
From: <rgr...@us...> - 2014-07-08 23:09:20
|
Revision: 12688
http://sourceforge.net/p/xoops/svn/12688
Author: rgriffith
Date: 2014-07-08 23:09:11 +0000 (Tue, 08 Jul 2014)
Log Message:
-----------
Fix issues when protector 'id_forceintval' preference is enabled, that manifests as an error when deleting private messages.
Modified Paths:
--------------
XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/pm/viewpmsg.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/viewpmsg.php
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/pm/viewpmsg.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/pm/viewpmsg.php 2014-07-08 19:32:05 UTC (rev 12687)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/pm/viewpmsg.php 2014-07-08 23:09:11 UTC (rev 12688)
@@ -34,17 +34,17 @@
$start = empty($_REQUEST["start"]) ? 0 : intval($_REQUEST["start"]);
$pm_handler =& xoops_getModuleHandler('message');
-if (isset($_POST['delete_messages']) && isset($_POST['msg_id'])) {
+if (isset($_POST['delete_messages']) && (isset($_POST['msg_id']) || isset($_POST['msg_ids']))) {
if (!$GLOBALS['xoopsSecurity']->check()) {
$GLOBALS['xoopsTpl']->assign('errormsg', implode('<br />', $GLOBALS['xoopsSecurity']->getErrors()));
} else if (empty($_REQUEST['ok'])) {
- xoops_confirm(array('ok' => 1, 'delete_messages' => 1, 'op' => $_REQUEST['op'], 'msg_id'=> json_encode(array_map("intval", $_POST['msg_id']))), $_SERVER['REQUEST_URI'], _PM_SURE_TO_DELETE);
+ xoops_confirm(array('ok' => 1, 'delete_messages' => 1, 'op' => $_REQUEST['op'], 'msg_ids'=> json_encode(array_map("intval", $_POST['msg_id']))), $_SERVER['REQUEST_URI'], _PM_SURE_TO_DELETE);
include $GLOBALS['xoops']->path('footer.php');
exit();
} else {
- $clean_msg_id = json_decode($_POST['msg_id'], true, 2);
+ $clean_msg_id = json_decode($_POST['msg_ids'], true, 2);
if (!empty($clean_msg_id)) {
- $clean_msg_id = array_map("intval", (array) $clean_msg_id);
+ $clean_msg_id = array_map("intval", $clean_msg_id);
}
$size = count($clean_msg_id);
$msg =& $clean_msg_id;
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/viewpmsg.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/viewpmsg.php 2014-07-08 19:32:05 UTC (rev 12687)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/viewpmsg.php 2014-07-08 23:09:11 UTC (rev 12688)
@@ -27,17 +27,17 @@
redirect_header("user.php", 2, $errormessage);
} else {
$pm_handler =& xoops_gethandler('privmessage');
- if (isset($_POST['delete_messages']) && isset($_POST['msg_id'])) {
+ if (isset($_POST['delete_messages']) && (isset($_POST['msg_id']) || isset($_POST['msg_ids']))) {
if (!$GLOBALS['xoopsSecurity']->check()) {
echo implode('<br />', $GLOBALS['xoopsSecurity']->getErrors());
exit();
} elseif (empty($_REQUEST['ok'])) {
include $GLOBALS['xoops']->path('header.php');
- xoops_confirm(array('ok' => 1, 'delete_messages' => 1, 'msg_id'=> json_encode(array_map("intval", $_POST['msg_id']))), $_SERVER['REQUEST_URI'], _PM_SURE_TO_DELETE);
+ xoops_confirm(array('ok' => 1, 'delete_messages' => 1, 'msg_ids'=> json_encode(array_map("intval", $_POST['msg_id']))), $_SERVER['REQUEST_URI'], _PM_SURE_TO_DELETE);
include $GLOBALS['xoops']->path('footer.php');
exit();
}
- $clean_msg_id = json_decode($_POST['msg_id'], true, 2);
+ $clean_msg_id = json_decode($_POST['msg_ids'], true, 2);
if (!empty($clean_msg_id)) {
$clean_msg_id = array_map("intval", $clean_msg_id);
}
|
|
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;
- }
+ }
+ }
}
}
$ret .= <<<EOT
@@ -147,7 +149,7 @@
}
}
// keywords
-{$moduleDirname}_meta_keywords(xoops_getModuleOption('keywords', \$dirname) .', '. implode(', ', \$keywords));
+{$moduleDirname}_meta_keywords(\${$moduleDirname}->getConfig('keywords').', '. implode(', ', \$keywords));
unset(\$keywords);
// description
{$moduleDirname}_meta_description({$language}{$stu_table_name}_DESC);
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-07 15:24:03 UTC (rev 12686)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/language/english/admin.php 2014-07-08 19:32:05 UTC (rev 12687)
@@ -30,16 +30,6 @@
define('_AM_TDMCREATE_THEREARE_NUMMODULES', "There are <span class='red bold'>%s</span> modules stored in the Database");
define('_AM_TDMCREATE_THEREARE_NUMTABLES', "There are <span class='red bold'>%s</span> tables stored in the Database");
define('_AM_TDMCREATE_THEREARE_NUMFIELDS', "There are <span class='red bold'>%s</span> fields stored in the Database");
-
-define('_AM_TDMCREATE_TABLES_FIELDS_MORE_ELEMENTS', "Forms: Elements");
-define('_AM_TDMCREATE_TABLES_FIELDS_MORE_PARENT_ID', "Parent: Category id");
-define('_AM_TDMCREATE_TABLES_FIELDS_MORE_DISPLAY_ADMIN', "Page: Show admin");
-define('_AM_TDMCREATE_TABLES_FIELDS_MORE_DISPLAY_USER', "Page: View User");
-define('_AM_TDMCREATE_TABLES_FIELDS_MORE_BLOC', "Block: View");
-define('_AM_TDMCREATE_TABLES_FIELDS_MORE_MAIN_FIELD', "Table: Main Field");
-define('_AM_TDMCREATE_TABLES_FIELDS_MORE_SEARCH', "Search: Index");
-define('_AM_TDMCREATE_TABLES_FIELDS_MORE_REQUIRED', "Forms: Required field");
-
// General
define('_AM_TDMCREATE_FORMOK', "Successfully saved");
define('_AM_TDMCREATE_FORMDELOK', "Successfully deleted");
@@ -54,7 +44,7 @@
define('_AM_TDMCREATE_FORM_INFO_TABLE_OPTIONAL_FIELD', "Optional fields");
define('_AM_TDMCREATE_FORM_INFO_TABLE_STRUCTURES_FIELD', "Structures fields");
define('_AM_TDMCREATE_FORM_INFO_TABLE_ICON_FIELD', "Icon fields");
-
+//
define('_AM_TDMCREATE_ID', "ID");
define('_AM_TDMCREATE_NAME', "Name");
define('_AM_TDMCREATE_BLOCKS', "Blocks");
@@ -70,8 +60,7 @@
//Form
define('_AM_TDMCREATE_MODULE_NEW', "New module");
define('_AM_TDMCREATE_MODULE_EDIT', "Edit module");
-//define('_AM_TDMCREATE_MODULE_IMPORTANT', "Required Information");
-
+//
define('_AM_TDMCREATE_MODULE_IMPORTANT', "<span style='color: #FF0000'>Required - Information</span>");
define('_AM_TDMCREATE_MODULE_NOTIMPORTANT', "<span style='color: #00FF00'>Optional - Information</span>");
define('_AM_TDMCREATE_MODULE_ID', "Id");
@@ -175,7 +164,6 @@
define('_AM_TDMCREATE_TABLE_IMAGE_DESC', "<span class='red bold'>WARNING</span>: If you want to choose a new image, is best to name it with the module name before and follow with the name of the image so as not to overwrite any images with the same name, in the <span class='bold'>Frameworks/moduleclasses/moduleadmin/icons/32/</span>. Otherwise an other solution, would be to insert the images in the module, a new folder is created, with the creation of the same module - <span class='bold'>images/32</span>.");
define('_AM_TDMCREATE_TABLE_FORM_CREATED_OK', "The table <b class='green'>%s</b> is successfully created");
define('_AM_TDMCREATE_TABLE_FORM_UPDATED_OK', "The table <b class='green'>%s</b> is successfully updated");
-
// ------------------ Form Fields ------------------
// Caption
define('_AM_TDMCREATE_FIELDS_NEW', "New fields");
@@ -298,8 +286,8 @@
define('_AM_TDMCREATE_BUILD_MODSELOPT', "Select and build a Module");
define('_AM_TDMCREATE_NOTMODULES', "There aren't modules, pleace create one first");
define('_AM_TDMCREATE_NOTTABLES', "There aren't tables, pleace create one first");
-define('_AM_TDMCREATE_FIELD_FORM_SAVED_OK', "Fields of table %s successfully saved");
-define('_AM_TDMCREATE_FIELD_FORM_UPDATED_OK', "Fields of table %s successfully updated");
+define('_AM_TDMCREATE_FIELDS_FORM_SAVED_OK', "Fields of table <b class='green'>%s</b> successfully saved");
+define('_AM_TDMCREATE_FIELDS_FORM_UPDATED_OK', "Fields of table <b class='green'>%s</b> successfully updated");
//
define('_AM_TDMCREATE_THEREARENT_MODULES', "There aren't modules");
define('_AM_TDMCREATE_THEREARENT_TABLES', "There aren't tables");
|
|
From: <go...@us...> - 2014-07-07 15:24:06
|
Revision: 12686
http://sourceforge.net/p/xoops/svn/12686
Author: goffy
Date: 2014-07-07 15:24:03 +0000 (Mon, 07 Jul 2014)
Log Message:
-----------
remove echo (still remained from testing period)
Modified Paths:
--------------
XoopsModules/xnewsletter/trunk/xNewsletter/include/mailinglist.php
Modified: XoopsModules/xnewsletter/trunk/xNewsletter/include/mailinglist.php
===================================================================
--- XoopsModules/xnewsletter/trunk/xNewsletter/include/mailinglist.php 2014-07-07 15:22:46 UTC (rev 12685)
+++ XoopsModules/xnewsletter/trunk/xNewsletter/include/mailinglist.php 2014-07-07 15:24:03 UTC (rev 12686)
@@ -48,13 +48,13 @@
$action_code = $obj_mailinglist->getVar("mailinglist_unsubscribe");
}
$action_code = str_replace("{email}", $subscr_email, $action_code);
-
+/*
echo "<br />type".$type;
echo "<br />subscr_id:".$subscr_id;
echo "<br />mailinglist_id:".$mailinglist_id;
echo "<br />action_code:$action_code";
echo "<br />";
-/* */
+ */
require_once( XOOPS_ROOT_PATH."/class/mail/phpmailer/class.phpmailer.php" );
require_once( XOOPS_ROOT_PATH."/class/mail/phpmailer/class.pop3.php" );
|
|
From: <go...@us...> - 2014-07-07 15:22:48
|
Revision: 12685
http://sourceforge.net/p/xoops/svn/12685
Author: goffy
Date: 2014-07-07 15:22:46 +0000 (Mon, 07 Jul 2014)
Log Message:
-----------
corrected check of right for reading newsletters for the list of newsletters in block
Modified Paths:
--------------
XoopsModules/xnewsletter/releases/1.2/xNewsletter/blocks/blocks_letter.php
Modified: XoopsModules/xnewsletter/releases/1.2/xNewsletter/blocks/blocks_letter.php
===================================================================
--- XoopsModules/xnewsletter/releases/1.2/xNewsletter/blocks/blocks_letter.php 2014-07-07 14:15:31 UTC (rev 12684)
+++ XoopsModules/xnewsletter/releases/1.2/xNewsletter/blocks/blocks_letter.php 2014-07-07 15:22:46 UTC (rev 12685)
@@ -86,7 +86,7 @@
$letter_cat_arr = explode("|", $letter_arr[$i]->getVar("letter_cats"));
$showcat = 0;
foreach (array_keys($letter_cat_arr) as $cat_id) {
- $showcat = $gperm_handler->checkRight( 'newsletter_create_cat', $cat_id, $my_group_ids, $mid ) ;
+ $showcat = $gperm_handler->checkRight( 'newsletter_read_cat', $cat_id, $my_group_ids, $mid ) ;
if ($showcat == 1 ) {
$letter[$i]["letter_id"] = $letter_arr[$i]->getVar("letter_id");
$letter_title = $letter_arr[$i]->getVar("letter_title");
|
|
From: <txm...@us...> - 2014-07-07 14:15:39
|
Revision: 12684
http://sourceforge.net/p/xoops/svn/12684
Author: txmodxoops
Date: 2014-07-07 14:15:31 +0000 (Mon, 07 Jul 2014)
Log Message:
-----------
- Renamed directory name from TDMCreate to tdmcreate
- Fix bug
Added Paths:
-----------
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/about.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/building.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/footer.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/header.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/index.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/menu.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/assets/
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/css/
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/css/admin/
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/css/admin/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/css/admin/style.css
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/css/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/css/style.css
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/empty.png
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/icons/
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/icons/16/
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/icons/16/arrow.gif
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/icons/16/blocks.png
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/icons/16/drag.png
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/icons/16/editfields.png
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/icons/16/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/icons/16/left_right.png
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/icons/16/nb_fields.png
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/icons/16/spinner.gif
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/icons/16/submenu.png
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/icons/16/tables.png
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/icons/16/toggle.png
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/icons/32/
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/icons/32/addmodule.png
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/icons/32/addtable.png
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/icons/32/builder.png
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/icons/32/dashboard.png
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/icons/32/edittable.png
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/icons/32/fields.png
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/icons/32/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/icons/blank.gif
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/icons/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/icons/loading.gif
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/loading.gif
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/logo.png
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/logos/
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/logos/VeraBd.ttf
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/logos/empty.png
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/logos/green.png
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/logos/red.png
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/logos/xoops2.png
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/logos/xoopsdevelopmentteam_logo.gif
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/naked.png
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/images/xcvLogo.txt
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/js/
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/js/fields.js
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/js/functions.js
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/assets/js/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/autoloader.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/building.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/fieldattributes.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/fieldelements.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/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/fieldtype.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/abstract.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/
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.html
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/
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/blocks/blocks.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/blocks/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/classes/
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/classes/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/css/
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/css/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/css/styles.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/docs/
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/docs/index.html
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/
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/index.html
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/
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/help.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/language/index.html
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/
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/sql/index.html
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/
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/admin/
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.html
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/
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/blocks/blocks.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/blocks/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/user/
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.html
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/
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.html
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
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/form/
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/form/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/form/themeform.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/helper.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/html/
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/html/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/html/simplelabel.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/logoGenerator.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/modules.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/session.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/docs/
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/docs/changelog.txt
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/docs/credits.txt
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/docs/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/docs/install.txt
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/docs/lang_diff.txt
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/docs/license.txt
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/docs/readme.txt
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/include/
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/include/common.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/include/functions.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/include/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/include/install.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/include/install_copy.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/include/update.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/language/
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/language/english/
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/language/english/admin.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/language/english/help/
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/language/english/help/help.html
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/language/english/help/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/language/english/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/language/english/modinfo.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/language/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/language/update language 1.0 to 1.1.txt
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/language/update language 1.1 to 1.15.txt
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/language/update language 1.1 to 1.37.txt
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/language/update language 1.15 to 1.37.txt
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/language/update language 1.37 to 1.38.txt
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/language/update language 1.38 to 1.39.txt
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/sql/
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/sql/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/sql/mysql.sql
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/templates/
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/templates/admin/
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/templates/admin/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/templates/admin/tdmcreate_about.tpl
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/templates/admin/tdmcreate_building.tpl
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/templates/admin/tdmcreate_fields.tpl
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/templates/admin/tdmcreate_footer.tpl
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/templates/admin/tdmcreate_header.tpl
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/templates/admin/tdmcreate_index.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/templates/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/xoops_version.php
Added: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/about.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/about.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/about.php 2014-07-07 14:15:31 UTC (rev 12684)
@@ -0,0 +1,25 @@
+<?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: about.php 11084 2013-02-23 15:44:20Z timgno $
+ */
+include 'header.php';
+$template_main = 'tdmcreate_about.tpl';
+$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('about.php'));
+$GLOBALS['xoopsTpl']->assign('about', $adminMenu->renderAbout('6KJ7RW5DR3VTJ', false));
+include 'footer.php';
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/building.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/building.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/building.php 2014-07-07 14:15:31 UTC (rev 12684)
@@ -0,0 +1,97 @@
+<?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: building.php 12258 2014-01-02 09:33:29Z timgno $
+ */
+include 'header.php';
+$op = XoopsRequest::getString('op', 'default');
+$mid = XoopsRequest::getInt('mod_id');
+$moduleObj = $tdmcreate->getHandler('modules')->get( $mid );
+// Switch option
+switch ($op) {
+ case 'build':
+ $template_main = 'tdmcreate_building.tpl';
+ $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('building.php'));
+ // Get var module dirname
+ $moduleDirname = $moduleObj->getVar('mod_dirname');
+ // Directories for copy from to
+ $fromDir = TDMC_UPLOAD_REPOSITORY_PATH.'/'.strtolower($moduleDirname);
+ $toDir = XOOPS_ROOT_PATH.'/modules/'.strtolower($moduleDirname);
+ if(isset($moduleDirname)) {
+ // Clear this module if it's in repository
+ if(is_dir($fromDir)) {
+ TDMCreate_clearDir($fromDir);
+ }
+ // Clear this module if it's in root/modules
+ if(is_dir($toDir)) {
+ TDMCreate_clearDir($toDir);
+ }
+ }
+ // Structure
+ include_once TDMC_PATH . '/class/files/architecture.php';
+ $handler = TDMCreateArchitecture::getInstance();
+ $handler->getPath( TDMC_PATH );
+ $handler->getUploadPath( TDMC_UPLOAD_PATH );
+ // Creation of the structure of folders and files
+ $base_architecture = $handler->createBaseFoldersFiles( $moduleObj );
+ if($base_architecture !== false) {
+ $GLOBALS['xoopsTpl']->assign('base_architecture', true);
+ } else {
+ $GLOBALS['xoopsTpl']->assign('base_architecture', false);
+ }
+ // Get files
+ $build = array();
+ $files = $handler->createFilesToBuilding( $moduleObj );
+ foreach($files as $file) {
+ if($file) {
+ $build['list'] = $file;
+ }
+ $GLOBALS['xoopsTpl']->append('builds', $build);
+ }
+ unset($build);
+ // Directory to saved all files
+ $GLOBALS['xoopsTpl']->assign('building_directory', sprintf(_AM_TDMCREATE_BUILDING_DIRECTORY, $moduleDirname));
+ // Copy this module in root modules
+ if( $moduleObj->getVar('mod_inroot_copy') == 1 ) {
+ TDMCreate_copyr($fromDir, $toDir);
+ }
+ break;
+
+ case 'default':
+ default:
+ $template_main = 'tdmcreate_building.tpl';
+ $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('building.php'));
+ // Redirect if there aren't modules
+ $nbModules = $tdmcreate->getHandler('modules')->getCount();
+ if( $nbModules == 0 ) {
+ redirect_header('modules.php?op=new', 2, _AM_TDMCREATE_NOTMODULES );
+ }
+ unset($nbModules);
+ // Redirect if there aren't tables
+ $nbTables = $tdmcreate->getHandler('tables')->getCount();
+ if($nbTables == 0) {
+ redirect_header('tables.php?op=new', 2, _AM_TDMCREATE_NOTTABLES );
+ }
+ unset($nbTables);
+ include_once TDMC_PATH . '/class/building.php';
+ $handler = TDMCreateBuilding::getInstance();
+ $form = $handler->getForm();
+ $GLOBALS['xoopsTpl']->assign('form', $form->render());
+ break;
+}
+include 'footer.php';
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/fields.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/fields.php 2014-07-07 14:15:31 UTC (rev 12684)
@@ -0,0 +1,329 @@
+<?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 fields.php 12258 2014-01-02 09:33:29Z timgno $
+ */
+include 'header.php';
+// Recovered value of arguments op in the URL $
+$op = XoopsRequest::getString('op', 'list');
+// Get fields Variables
+$field_mid = 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');
+$fieldTid = XoopsRequest::getInt('field_tid');
+$fieldNumb = XoopsRequest::getInt('field_numb');
+$fieldName = XoopsRequest::getString('field_name', ''); */
+//
+switch ($op)
+{
+ case 'list':
+ default:
+ $start = XoopsRequest::getInt('start', 0);
+ $limit = XoopsRequest::getInt('limit', $tdmcreate->getConfig('tables_adminpager'));
+ // Define main template
+ $template_main = 'tdmcreate_fields.tpl';
+ $GLOBALS['xoTheme']->addStylesheet( 'modules/TDMCreate/assets/css/admin/style.css' );
+ $GLOBALS['xoTheme']->addScript('modules/TDMCreate/assets/js/functions.js');
+ $GLOBALS['xoTheme']->addScript('modules/TDMCreate/assets/js/fields.js');
+ $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('fields.php'));
+ $adminMenu->addItemButton(_AM_TDMCREATE_ADD_TABLE, 'tables.php?op=new', 'add');
+ $GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
+ $GLOBALS['xoopsTpl']->assign('tdmc_url', TDMC_URL);
+ $GLOBALS['xoopsTpl']->assign('tdmc_icons_url', TDMC_ICONS_URL);
+ $GLOBALS['xoopsTpl']->assign('tdmc_upload_url', TDMC_UPLOAD_URL);
+ $GLOBALS['xoopsTpl']->assign('tdmc_upload_imgtab_url', TDMC_UPLOAD_IMGTAB_URL);
+ $GLOBALS['xoopsTpl']->assign('modPathIcon16', $modPathIcon16);
+ $GLOBALS['xoopsTpl']->assign('sysPathIcon32', $sysPathIcon32);
+ //var_dump($sysPathIcon32);
+ // Redirect if there aren't modules
+ $nb_modules = $tdmcreate->getHandler('modules')->getCount();
+ if ( $nb_modules == 0 ) {
+ redirect_header('modules.php?op=new', 2, _AM_TDMCREATE_NOTMODULES );
+ }
+ unset($nb_modules);
+ // Redirect if there aren't tables
+ $nb_tables = $tdmcreate->getHandler('tables')->getCount();
+ if ($nb_tables == 0) {
+ redirect_header('tables.php?op=new', 2, _AM_TDMCREATE_NOTTABLES );
+ }
+ unset($nb_tables);
+ // 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);
+ unset($criteria);
+ if ($nb_tables > 0)
+ {
+ foreach (array_keys($tables_arr) 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');
+ // Get the list of fields
+ $criteria = new CriteriaCompo();
+ $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);
+ unset($criteria);
+ // Display fields list
+ $fields = array();
+ $lid = 1;
+ if ( $nb_fields > 0 )
+ {
+ foreach (array_keys($fields_arr) 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');
+ $fields[] = $field;
+ unset($field);
+ $lid++;
+ }
+ }
+ unset($lid);
+ $table['fields'] = $fields;
+ $GLOBALS['xoopsTpl']->append('tables_list', $table);
+ unset($table);
+ }
+ if ( $nb_tables > $limit ) {
+ include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
+ $pagenav = new XoopsPageNav($nb_tables, $limit, $start, 'start', 'op=list&limit=' . $limit);
+ $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4));
+ }
+ } else {
+ $GLOBALS['xoopsTpl']->assign('error', _AM_TDMCREATE_THEREARENT_FIELDS);
+ }
+ break;
+
+ case 'new':
+ // Define main template
+ $template_main = 'tdmcreate_fields.tpl';
+ $GLOBALS['xoTheme']->addStylesheet( 'modules/TDMCreate/assets/css/admin/style.css' );
+ $GLOBALS['xoTheme']->addScript('modules/TDMCreate/assets/js/fields.js');
+ $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('fields.php'));
+ $adminMenu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php', 'list');
+ $adminMenu->addItemButton(_AM_TDMCREATE_FIELDS_LIST, 'fields.php', 'list');
+ $GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
+ // Form Add
+ $fieldsObj =& $tdmcreate->getHandler('fields')->create();
+ $form = $fieldsObj->getFormNew($field_mid, $fieldTid, $fieldNumb, $fieldName);
+ $GLOBALS['xoopsTpl']->assign('form', $form->render());
+ // Test -> Will be removed
+ var_dump($field_mid);
+ var_dump($fieldTid);
+ var_dump($fieldNumb);
+ var_dump($fieldName);
+ break;
+
+ case 'save':
+ //
+ if ( !$GLOBALS['xoopsSecurity']->check() ) {
+ redirect_header('fields.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
+ }
+ $field_id = XoopsRequest::getInt('field_id');
+ // Fields Handler
+ $fields = $tdmcreate->getHandler('fields');
+ // 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($field_mid) && isset($fieldTid) && !empty($_POST['field_name'][$key])) {
+ // Set Data
+ $fieldsObj->setVar( 'field_mid', $field_mid );
+ $fieldsObj->setVar( 'field_tid', $fieldTid );
+ $fieldsObj->setVar( 'field_numb', $fieldNumb );
+ $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] : '') );
+ $fieldsObj->setVar( 'field_attribute', (isset($_POST['field_attribute'][$key]) ? $_POST['field_attribute'][$key] : '') );
+ $fieldsObj->setVar( 'field_null', (isset($_POST['field_null'][$key]) ? $_POST['field_null'][$key] : '') );
+ $fieldsObj->setVar( 'field_default', (isset($_POST['field_default'][$key]) ? $_POST['field_default'][$key] : '') );
+ $fieldsObj->setVar( 'field_key', (isset($_POST['field_key'][$key]) ? $_POST['field_key'][$key] : '') );
+ $fieldsObj->setVar( 'field_element', (isset($_POST['field_element'][$key]) ? $_POST['field_element'][$key] : '') );
+ $fieldsObj->setVar( 'field_parent', ((isset($_REQUEST['field_parent'][$key]) == 1) ? 1 : 0) );
+ $fieldsObj->setVar( 'field_inlist', ((isset($_REQUEST['field_inlist'][$key]) == 1) ? 1 : 0) );
+ $fieldsObj->setVar( 'field_inform', ((isset($_REQUEST['field_inform'][$key]) == 1) ? 1 : 0) );
+ $fieldsObj->setVar( 'field_admin', ((isset($_REQUEST['field_admin'][$key]) == 1) ? 1 : 0) );
+ $fieldsObj->setVar( 'field_user', ((isset($_REQUEST['field_user'][$key]) == 1) ? 1 : 0) );
+ $fieldsObj->setVar( 'field_block', ((isset($_REQUEST['field_block'][$key]) == 1) ? 1 : 0) );
+ $fieldsObj->setVar( 'field_main', (($key == isset($_REQUEST['field_main'][$key])) ? 1 : 0) );
+ $fieldsObj->setVar( 'field_search', ((isset($_REQUEST['field_search'][$key]) == 1) ? 1 : 0) );
+ $fieldsObj->setVar( 'field_required', ((isset($_REQUEST['field_required'][$key]) == 1) ? 1 : 0) );
+ // Insert Data
+ $tdmcreate->getHandler('fields')->insert($fieldsObj);
+ }
+ }
+ // Get table name from field table id
+ $tables =& $tdmcreate->getHandler('tables')->get($fieldTid);
+ $table_name = $tables->getVar('table_name');
+ // Set field elements
+ if ($fieldsObj->isNew()) {
+ // Fields Elements Handler
+ $fieldelementObj =& $tdmcreate->getHandler('fieldelements')->create();
+ $fieldelementObj->setVar( 'fieldelement_mid', $field_mid );
+ $fieldelementObj->setVar( 'fieldelement_tid', $fieldTid );
+ $fieldelementObj->setVar( 'fieldelement_name', 'Table : '.ucfirst($table_name) );
+ $fieldelementObj->setVar( 'fieldelement_value', 'XoopsFormTables-'.ucfirst($table_name) );
+ // Insert new field element id for table name
+ if (!$tdmcreate->getHandler('fieldelements')->insert($fieldelementObj) ) {
+ $GLOBALS['xoopsTpl']->assign('error', $fieldelementObj->getHtmlErrors() . ' Field element');
+ }
+ redirect_header('fields.php', 2, sprintf(_AM_TDMCREATE_FIELD_FORM_SAVED_OK, $table_name));
+ } else {
+ redirect_header('fields.php', 2, sprintf(_AM_TDMCREATE_FIELD_FORM_UPDATED_OK, $table_name));
+ }
+ //
+ $GLOBALS['xoopsTpl']->assign('error', $fieldsObj->getHtmlErrors());
+ $form = $fieldsObj->getForm(null, $fieldTid);
+ $GLOBALS['xoopsTpl']->assign('form', $form->render());
+ break;
+
+ case 'edit':
+ // Define main template
+ $template_main = 'tdmcreate_fields.tpl';
+ $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('fields.php'));
+ $adminMenu->addItemButton(_AM_TDMCREATE_ADD_TABLE, 'tables.php?op=new', 'add');
+ $adminMenu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php', 'list');
+ $adminMenu->addItemButton(_AM_TDMCREATE_FIELDS_LIST, 'fields.php', 'list');
+ $GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
+ // Form Edit
+ $field_id = XoopsRequest::getInt('field_id');
+ $fieldsObj = $tdmcreate->getHandler('fields')->get( $field_id );
+ $form = $fieldsObj->getFormEdit($field_mid, $fieldTid);
+ $GLOBALS['xoopsTpl']->assign('form', $form->render());
+ // Test -> Will be removed
+ var_dump($fieldTid);
+ break;
+
+ 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 );
+ $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;
+ break;
+
+ case 'display':
+ // 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);
+ 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);
+ }
+ }
+ break;
+}
+include 'footer.php';
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/footer.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/footer.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/footer.php 2014-07-07 14:15:31 UTC (rev 12684)
@@ -0,0 +1,26 @@
+<?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: footer.php 12207 2013-10-23 02:46:52Z beckmi $
+ */
+$GLOBALS['xoopsTpl']->assign('module_name', $GLOBALS['xoopsModule']->getVar('name'));
+if ( isset($template_main) ) {
+ $GLOBALS['xoopsTpl']->display("db:{$template_main}");
+}
+xoops_cp_footer();
+?>
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/header.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/header.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/header.php 2014-07-07 14:15:31 UTC (rev 12684)
@@ -0,0 +1,57 @@
+<?php
+/*
+ You may not change or alter any portion of this comment or credits
+ of supporting developers from this source code or any supporting source code
+ which is considered copyrighted (c) material of the original comment or credit authors.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+/**
+ * tdmcreate module
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package tdmcreate
+ * @since 2.5.0
+ * @author Txmod Xoops http://www.txmodxoops.org
+ * @version $Id: header.php 12258 2014-01-02 09:33:29Z timgno $
+*/
+include_once dirname(dirname(dirname(dirname(__FILE__)))) . '/include/cp_header.php';
+include_once dirname(dirname(__FILE__)) . '/include/common.php';
+//
+$thisDirname = $GLOBALS['xoopsModule']->getVar('dirname');
+// Link System Icons
+$sysPathIcon16 = $GLOBALS['xoopsModule']->getInfo('sysicons16');
+$sysPathIcon32 = $GLOBALS['xoopsModule']->getInfo('sysicons32');
+// Link Local Icons
+$modPathIcon16 = $GLOBALS['xoopsModule']->getInfo('modicons16');
+$modPathIcon32 = $GLOBALS['xoopsModule']->getInfo('modicons32');
+$pathModuleAdmin = $GLOBALS['xoopsModule']->getInfo('dirmoduleadmin');
+// TDMCreate Instance
+$tdmcreate = TDMCreate::getInstance();
+// MyTextSanitizer
+$myts =& MyTextSanitizer::getInstance();
+if (!isset($xoopsTpl) || !is_object($xoopsTpl)) {
+ include_once(XOOPS_ROOT_PATH."/class/template.php");
+ $xoopsTpl = new XoopsTpl();
+}
+// System Icons
+$GLOBALS['xoopsTpl']->assign('sysPathIcon16', $sysPathIcon16);
+$GLOBALS['xoopsTpl']->assign('sysPathIcon32', $sysPathIcon32);
+// Local Icons
+$GLOBALS['xoopsTpl']->assign('modPathIcon16', $modPathIcon16);
+$GLOBALS['xoopsTpl']->assign('modPathIcon32', $modPathIcon32);
+// Load languages
+xoops_loadLanguage('admin', $thisDirname);
+xoops_loadLanguage('modinfo', $thisDirname);
+xoops_loadLanguage('main', $thisDirname);
+// Locad admin menu class
+if ( file_exists($GLOBALS['xoops']->path($pathModuleAdmin.'/moduleadmin.php'))){
+ include_once $GLOBALS['xoops']->path($pathModuleAdmin.'/moduleadmin.php');
+}else{
+ redirect_header("../../../admin.php", 5, _AM_MODULEADMIN_MISSING, false);
+}
+xoops_cp_header();
+$adminMenu = new ModuleAdmin();
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/index.html
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/index.html (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/index.html 2014-07-07 14:15:31 UTC (rev 12684)
@@ -0,0 +1 @@
+ <script>history.go(-1);</script>
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/index.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/index.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/index.php 2014-07-07 14:15:31 UTC (rev 12684)
@@ -0,0 +1,35 @@
+<?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: index.php 11084 2013-02-23 15:44:20Z timgno $
+ */
+include 'header.php';
+$criteria = new CriteriaCompo();
+$count_modules = $tdmcreate->getHandler('modules')->getCount($criteria);
+$count_tables = $tdmcreate->getHandler('tables')->getCount($criteria);
+$count_fields = $tdmcreate->getHandler('fields')->getCount($criteria);
+unset($criteria);
+$template_main = 'tdmcreate_index.tpl';
+$adminMenu->addInfoBox(_AM_TDMCREATE_ADMIN_NUMMODULES) ;
+$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, '<label>' ._AM_TDMCREATE_THEREARE_NUMMODULES. '</label>', $count_modules, 'Green') ;
+$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, '<label>' ._AM_TDMCREATE_THEREARE_NUMTABLES. '</label>', $count_tables, 'Orange');
+$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, '<label>' ._AM_TDMCREATE_THEREARE_NUMFIELDS. '</label>', $count_fields, 'Gray');
+//$xoopsOption['template_main'] = 'tdmcreate_index.html';
+$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('index.php'));
+$GLOBALS['xoopsTpl']->assign('index', $adminMenu->renderIndex());
+include 'footer.php';
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/menu.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/menu.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/menu.php 2014-07-07 14:15:31 UTC (rev 12684)
@@ -0,0 +1,50 @@
+<?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: menu.php 11084 2013-02-23 15:44:20Z timgno $
+ */
+$module_handler =& xoops_gethandler('module');
+$xoopsModule =& XoopsModule::getByDirname('TDMCreate');
+$moduleInfo =& $module_handler->get($xoopsModule->getVar('mid'));
+$sysPathIcon32 = $moduleInfo->getInfo('sysicons32');
+$adminmenu = array();
+$i = 1;
+$adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU1;
+$adminmenu[$i]['link'] = 'admin/index.php';
+$adminmenu[$i]['icon'] = $sysPathIcon32.'/dashboard.png';
+$i++;
+$adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU2;
+$adminmenu[$i]['link'] = 'admin/modules.php';
+$adminmenu[$i]['icon'] = 'assets/images/icons/32/addmodule.png';
+$i++;
+$adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU3;
+$adminmenu[$i]['link'] = 'admin/tables.php';
+$adminmenu[$i]['icon'] = 'assets/images/icons/32/addtable.png';
+$i++;
+$adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU4;
+$adminmenu[$i]['link'] = 'admin/fields.php';
+$adminmenu[$i]['icon'] = 'assets/images/icons/32/fields.png';
+$i++;
+$adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU5;
+$adminmenu[$i]['link'] = 'admin/building.php';
+$adminmenu[$i]['icon'] = 'assets/images/icons/32/builder.png';
+$i++;
+$adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU6;
+$adminmenu[$i]['link'] = 'admin/about.php';
+$adminmenu[$i]['icon'] = $sysPathIcon32.'/about.png';
+unset($i);
Added: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/modules.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/modules.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/modules.php 2014-07-07 14:15:31 UTC (rev 12684)
@@ -0,0 +1,238 @@
+<?php
+/*
+ You may not change or alter any portion of this comment or credits
+ of supporting developers from this source code or any supporting source code
+ which is considered copyrighted (c) material of the original comment or credit authors.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+/**
+ * tdmcreate module
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package tdmcreate
+ * @since 2.5.5
+ * @author Txmod Xoops <su...@tx...>
+ * @version $Id: 1.59 modules.php 11297 2013-03-24 10:58:10Z timgno $
+ */
+include 'header.php';
+// Recovered value of argument op in the URL $
+$op = XoopsRequest::getString('op', 'list');
+//
+$mod_id = XoopsRequest::getInt('mod_id');
+//
+switch ($op)
+{
+ case 'list':
+ default:
+ $start = XoopsRequest::getInt('start', 0);
+ $limit = XoopsRequest::getInt('limit', $tdmcreate->getConfig('modules_adminpager'));
+ // Define main template
+ $template_main = 'tdmcreate_modules.tpl';
+ $GLOBALS['xoTheme']->addScript('modules/TDMCreate/assets/js/functions.js');
+ $GLOBALS['xoTheme']->addStylesheet( 'modules/TDMCreate/assets/css/admin/style.css' );
+ $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('modules.php'));
+ $adminMenu->addItemButton(_AM_TDMCREATE_ADD_MODULE, 'modules.php?op=new', 'add');
+ $GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
+ $GLOBALS['xoopsTpl']->assign('tdmc_url', TDMC_URL);
+ $GLOBALS['xoopsTpl']->assign('tdmc_upload_imgmod_url', TDMC_UPLOAD_IMGMOD_URL);
+ $GLOBALS['xoopsTpl']->assign('modPathIcon16', $modPathIcon16);
+ $GLOBALS['xoopsTpl']->assign('sysPathIcon32', $sysPathIcon32);
+ $criteria = new CriteriaCompo();
+ $criteria->setSort('mod_id ASC, mod_name');
+ $criteria->setOrder('ASC');
+ $nb_modules = $tdmcreate->getHandler('modules')->getCount( $criteria );
+ $mods_arr = $tdmcreate->getHandler('modules')->getAll( $criteria );
+ unset($criteria);
+ // Redirect if there aren't modules
+ if ( $nb_modules == 0 ) {
+ redirect_header('modules.php?op=new', 2, _AM_TDMCREATE_NOTMODULES );
+ }
+ // Display modules list
+ if ( $nb_modules > 0 ) {
+ foreach (array_keys($mods_arr) as $i) {
+ $mod['id'] = $i;
+ $mod['name'] = $mods_arr[$i]->getVar('mod_name');
+ $mod['version'] = $mods_arr[$i]->getVar('mod_version');
+ $mod['image'] = $mods_arr[$i]->getVar('mod_image');
+ $mod['release'] = $mods_arr[$i]->getVar('mod_release');
+ $mod['status'] = $mods_arr[$i]->getVar('mod_status');
+ $mod['admin'] = $mods_arr[$i]->getVar('mod_admin');
+ $mod['user'] = $mods_arr[$i]->getVar('mod_user');
+ $mod['search'] = $mods_arr[$i]->getVar('mod_search');
+ $mod['comments'] = $mods_arr[$i]->getVar('mod_comments');
+ $mod['notifications'] = $mods_arr[$i]->getVar('mod_notifications');
+ $mod['permissions'] = $mods_arr[$i]->getVar('mod_permissions');
+ $GLOBALS['xoopsTpl']->append('modules_list', $mod);
+ unset($mod);
+ }
+ if ( $nb_modules > $limit ) {
+ include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
+ $pagenav = new XoopsPageNav($nb_modules, $limit, $start, 'start', 'op=list&limit=' . $limit);
+ $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4));
+ }
+ } else {
+ $GLOBALS['xoopsTpl']->assign('error', _AM_TDMCREATE_THEREARENT_MODULES);
+ }
+ break;
+
+ case 'new':
+ // Define main template
+ $template_main = 'tdmcreate_modules.tpl';
+ $GLOBALS['xoTheme']->addScript('modules/TDMCreate/assets/js/functions.js');
+ $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('modules.php'));
+ $adminMenu->addItemButton(_AM_TDMCREATE_MODULES_LIST, 'modules.php', 'list');
+ $GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
+
+ $modulesObj =& $tdmcreate->getHandler('modules')->create();
+ $form = $modulesObj->getForm();
+ $GLOBALS['xoopsTpl']->assign('form', $form->render());
+ break;
+
+ case 'save':
+ if ( !$GLOBALS['xoopsSecurity']->check() ) {
+ redirect_header('modules.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
+ }
+ if (isset($mod_id)) {
+ $modulesObj =& $tdmcreate->getHandler('modules')->get($mod_id);
+ } else {
+ $modulesObj =& $tdmcreate->getHandler('modules')->create();
+ }
+ $moduleDirname = preg_replace('/[^a-zA-Z0-9]\s+/', '', strtolower($_POST['mod_dirname']));
+ //Form module save
+ $modulesObj->setVars(array('mod_name' => $_POST['mod_name'],
+ 'mod_dirname' => $moduleDirname,
+ 'mod_version' => $_POST['mod_version'],
+ 'mod_since' => $_POST['mod_since'],
+ 'mod_min_php' => $_POST['mod_min_php'],
+ 'mod_min_xoops' => $_POST['mod_min_xoops'],
+ 'mod_min_admin' => $_POST['mod_min_admin'],
+ 'mod_min_mysql' => $_POST['mod_min_mysql'],
+ 'mod_description' => $_POST['mod_description'],
+ 'mod_author' => $_POST['mod_author'],
+ 'mod_author_mail' => $_POST['mod_author_mail'],
+ 'mod_author_website_url' => $_POST['mod_author_website_url'],
+ 'mod_author_website_name' => $_POST['mod_author_website_name'],
+ 'mod_credits' => $_POST['mod_credits'],
+ 'mod_license' => $_POST['mod_license'],
+ 'mod_release_info' => $_POST['mod_release_info'],
+ 'mod_release_file' => $_POST['mod_release_file'],
+ 'mod_manual' => $_POST['mod_manual'],
+ 'mod_manual_file' => $_POST['mod_manual_file']));
+ //Form mod_image
+ include_once XOOPS_ROOT_PATH . '/class/uploader.php';
+ $uploader = new XoopsMediaUploader(TDMC_UPLOAD_IMGMOD_PATH, $tdmcreate->getConfig('mimetypes'),
+ $tdmcreate->getConfig('maxsize'), null, null);
+ if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) {
+ /*$extension = preg_replace( '/.*\.([^.]+)$/', '\\1', $_FILES['attachedfile']['name']);
+ $logo_image = $moduleDirname.'_slogo.'.$extension;
+ $uploader->setPrefix($logo_image);*/
+ $uploader->fetchMedia($_POST['xoops_upload_file'][0]);
+ if (!$uploader->upload()) {
+ $errors = $uploader->getErrors();
+ redirect_header('javascript:history.go(-1)',3, $errors);
+ } else {
+ $modulesObj->setVar('mod_image', $uploader->getSavedFileName());
+ }
+ } else {
+ $modulesObj->setVar('mod_image', $_POST['mod_image']);
+ }
+ //Form module save
+ $modulesObj->setVars(array('mod_demo_site_url' => $_POST['mod_demo_site_url'],
+ 'mod_demo_site_name' => $_POST['mod_demo_site_name'],
+ 'mod_support_url' => $_POST['mod_support_url'],
+ 'mod_support_name' => $_POST['mod_support_name'],
+ 'mod_website_url' => $_POST['mod_website_url'],
+ 'mod_website_name' => $_POST['mod_website_name'],
+ 'mod_release' => $_POST['mod_release'],
+ 'mod_status' => $_POST['mod_status'],
+ 'mod_admin' => (($_REQUEST['mod_admin'] == 1) ? '1' : '0'),
+ 'mod_user' => (($_REQUEST['mod_user'] == 1) ? '1' : '0'),
+ 'mod_blocks' => (($_REQUEST['mod_blocks'] == 1) ? '1' : '0'),
+ 'mod_search' => (($_REQUEST['mod_search'] == 1) ? '1' : '0'),
+ 'mod_comments' => (($_REQUEST['mod_comments'] == 1) ? '1' : '0'),
+ 'mod_notifications' => (($_REQUEST['mod_notifications'] == 1) ? '1' : '0'),
+ 'mod_permissions' => (($_REQUEST['mod_permissions'] == 1) ? '1' : '0'),
+ 'mod_inroot_copy' => (($_REQUEST['mod_inroot_copy'] == 1) ? '1' : '0'),
+ 'mod_donations' => $_POST['mod_donations'],
+ 'mod_subversion' => $_POST['mod_subversion'])
+ );
+
+ if ($tdmcreate->getHandler('modules')->insert($modulesObj)) {
+ if( $modulesObj->isNew() ) {
+ redirect_header('modules.php', 5, sprintf(_AM_TDMCREATE_MODULE_FORM_CREATED_OK, $_POST['mod_name']));
+ } else {
+ redirect_header('modules.php', 5, sprintf(_AM_TDMCREATE_MODULE_FORM_UPDATED_OK, $_POST['mod_name']));
+ }
+ }
+
+ $GLOBALS['xoopsTpl']->assign('error', $modulesObj->getHtmlErrors());
+ $form =& $modulesObj->getForm();
+ $GLOBALS['xoopsTpl']->assign('form', $form->render());
+ break;
+
+ case 'edit':
+ // Define main template
+ $template_main = 'tdmcreate_modules.tpl';
+ $GLOBALS['xoTheme']->addScript('modules/TDMCreate/assets/js/functions.js');
+ $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('modules.php'));
+ $adminMenu->addItemButton(_AM_TDMCREATE_ADD_MODULE, 'modules.php?op=new', 'add');
+ $adminMenu->addItemButton(_AM_TDMCREATE_MODULES_LIST, 'modules.php', 'list');
+ $GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
+
+ $modulesObj = $tdmcreate->getHandler('modules')->get($mod_id);
+ $form = $modulesObj->getForm();
+ $GLOBALS['xoopsTpl']->assign('form', $form->render());
+ break;
+
+ case 'delete':
+ $modulesObj =& $tdmcreate->getHandler('modules')->get($mod_id);
+ if (isset($_REQUEST['ok']) && $_REQUEST['ok'] == 1) {
+ if ( !$GLOBALS['xoopsSecurity']->check() ) {
+ redirect_header('modules.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
+ }
+ if ($tdmcreate->getHandler('modules')->delete($modulesObj)) {
+ redirect_header('modules.php', 3, _AM_TDMCREATE_FORMDELOK);
+ } else {
+ $GLOBALS['xoopsTpl']->assign('error', $modulesObj->getHtmlErrors());
+ }
+ } else {
+ xoops_confirm(array('ok' => 1, 'mod_id' => $mod_id, 'op' => 'delete'), $_SERVER['REQUEST_URI'], sprintf(_AM_TDMCREATE_FORMSUREDEL, $modulesObj->getVar('mod_name')));
+ }
+ break;
+
+ case 'display':
+ $mod_admin = XoopsRequest::getInt('mod_ad...
[truncated message content] |
|
From: <txm...@us...> - 2014-07-07 14:09:30
|
Revision: 12683
http://sourceforge.net/p/xoops/svn/12683
Author: txmodxoops
Date: 2014-07-07 14:09:21 +0000 (Mon, 07 Jul 2014)
Log Message:
-----------
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_fields.tpl
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_fields.tpl
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_fields.tpl 2014-07-07 14:07:04 UTC (rev 12682)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_fields.tpl 2014-07-07 14:09:21 UTC (rev 12683)
@@ -34,15 +34,15 @@
<td class='center'><u class='bold'><{$table.name}></u></td>
<td class='center'><img src="<{xoModuleIcons32}><{$table.image}>" alt="<{$table.name}>" height="22" /></td>
<td class='center bold'><{$table.nbfields}></td>
- <td class='center'><img src="<{$modPathIcon16}>/nb_fields.png" /></td>
- <td class='center'><img src="<{$modPathIcon16}>/nb_fields.png" /></td>
- <td class='center'><img src="<{$modPathIcon16}>/nb_fields.png" /></td>
- <td class='center'><img src="<{$modPathIcon16}>/nb_fields.png" /></td>
- <td class='center'><img src="<{$modPathIcon16}>/nb_fields.png" /></td>
- <td class='center'><img src="<{$modPathIcon16}>/nb_fields.png" /></td>
- <td class='center'><img src="<{$modPathIcon16}>/nb_fields.png" /></td>
- <td class='center'><img src="<{$modPathIcon16}>/nb_fields.png" /></td>
- <td class='center'><img src="<{$modPathIcon16}>/nb_fields.png" /></td>
+ <td class='center'><img src="<{$modPathIcon16}>/fields.png" /></td>
+ <td class='center'><img src="<{$modPathIcon16}>/fields.png" /></td>
+ <td class='center'><img src="<{$modPathIcon16}>/fields.png" /></td>
+ <td class='center'><img src="<{$modPathIcon16}>/fields.png" /></td>
+ <td class='center'><img src="<{$modPathIcon16}>/fields.png" /></td>
+ <td class='center'><img src="<{$modPathIcon16}>/fields.png" /></td>
+ <td class='center'><img src="<{$modPathIcon16}>/fields.png" /></td>
+ <td class='center'><img src="<{$modPathIcon16}>/fields.png" /></td>
+ <td class='center'><img src="<{$modPathIcon16}>/fields.png" /></td>
<td class='xo-actions txtcenter width6'>
<a href="tables.php?op=edit&table_mid=<{$table.mid}>&table_id=<{$table.id}>" title="<{$smarty.const._AM_TDMCREATE_EDIT_TABLE}>">
<img src="<{xoModuleIcons16 edit.png}>" alt="<{$smarty.const._AM_TDMCREATE_EDIT_TABLE}>" />
|
|
From: <txm...@us...> - 2014-07-07 14:07:08
|
Revision: 12682
http://sourceforge.net/p/xoops/svn/12682
Author: txmodxoops
Date: 2014-07-07 14:07:04 +0000 (Mon, 07 Jul 2014)
Log Message:
-----------
- Renamed directory name from TDMCreate to tdmcreate
- Fix bug
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include/update.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/install.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/update.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/admin.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/xoops_version.php
Added Paths:
-----------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/fields.png
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/xoops_logo.gif
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/autoloader.php
Removed Paths:
-------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/nb_fields.png
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/xoopsdevelopmentteam_logo.gif
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php 2014-07-07 09:44:50 UTC (rev 12681)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php 2014-07-07 14:07:04 UTC (rev 12682)
@@ -87,8 +87,8 @@
$adminMenu->addItemButton(_AM_TDMCREATE_MODULES_LIST, 'modules.php', 'list');
$GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
- $obj =& $tdmcreate->getHandler('modules')->create();
- $form = $obj->getForm();
+ $modulesObj =& $tdmcreate->getHandler('modules')->create();
+ $form = $modulesObj->getForm();
$GLOBALS['xoopsTpl']->assign('form', $form->render());
break;
@@ -97,14 +97,14 @@
redirect_header('modules.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
}
if (isset($mod_id)) {
- $obj =& $tdmcreate->getHandler('modules')->get($mod_id);
+ $modulesObj =& $tdmcreate->getHandler('modules')->get($mod_id);
} else {
- $obj =& $tdmcreate->getHandler('modules')->create();
+ $modulesObj =& $tdmcreate->getHandler('modules')->create();
}
- $mod_dirname = preg_replace('/[^a-zA-Z0-9]\s+/', '', strtolower($_POST['mod_dirname']));
+ $moduleDirname = preg_replace('/[^a-zA-Z0-9]\s+/', '', strtolower($_POST['mod_dirname']));
//Form module save
- $obj->setVars(array('mod_name' => $_POST['mod_name'],
- 'mod_dirname' => $mod_dirname,
+ $modulesObj->setVars(array('mod_name' => $_POST['mod_name'],
+ 'mod_dirname' => $moduleDirname,
'mod_version' => $_POST['mod_version'],
'mod_since' => $_POST['mod_since'],
'mod_min_php' => $_POST['mod_min_php'],
@@ -128,20 +128,20 @@
$tdmcreate->getConfig('maxsize'), null, null);
if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) {
/*$extension = preg_replace( '/.*\.([^.]+)$/', '\\1', $_FILES['attachedfile']['name']);
- $logo_image = $mod_dirname.'_slogo.'.$extension;
+ $logo_image = $moduleDirname.'_slogo.'.$extension;
$uploader->setPrefix($logo_image);*/
$uploader->fetchMedia($_POST['xoops_upload_file'][0]);
if (!$uploader->upload()) {
$errors = $uploader->getErrors();
redirect_header('javascript:history.go(-1)',3, $errors);
} else {
- $obj->setVar('mod_image', $uploader->getSavedFileName());
+ $modulesObj->setVar('mod_image', $uploader->getSavedFileName());
}
} else {
- $obj->setVar('mod_image', $_POST['mod_image']);
+ $modulesObj->setVar('mod_image', $_POST['mod_image']);
}
//Form module save
- $obj->setVars(array('mod_demo_site_url' => $_POST['mod_demo_site_url'],
+ $modulesObj->setVars(array('mod_demo_site_url' => $_POST['mod_demo_site_url'],
'mod_demo_site_name' => $_POST['mod_demo_site_name'],
'mod_support_url' => $_POST['mod_support_url'],
'mod_support_name' => $_POST['mod_support_name'],
@@ -150,7 +150,8 @@
'mod_release' => $_POST['mod_release'],
'mod_status' => $_POST['mod_status'],
'mod_admin' => (($_REQUEST['mod_admin'] == 1) ? '1' : '0'),
- 'mod_user' => (($_REQUEST['mod_user'] == 1) ? '1' : '0'),
+ 'mod_user' => (($_REQUEST['mod_user'] == 1) ? '1' : '0'),
+ 'mod_blocks' => (($_REQUEST['mod_blocks'] == 1) ? '1' : '0'),
'mod_search' => (($_REQUEST['mod_search'] == 1) ? '1' : '0'),
'mod_comments' => (($_REQUEST['mod_comments'] == 1) ? '1' : '0'),
'mod_notifications' => (($_REQUEST['mod_notifications'] == 1) ? '1' : '0'),
@@ -160,12 +161,16 @@
'mod_subversion' => $_POST['mod_subversion'])
);
- if ($tdmcreate->getHandler('modules')->insert($obj)) {
- redirect_header('modules.php', 2, _AM_TDMCREATE_FORMOK);
+ if ($tdmcreate->getHandler('modules')->insert($modulesObj)) {
+ if( $modulesObj->isNew() ) {
+ redirect_header('modules.php', 5, sprintf(_AM_TDMCREATE_MODULE_FORM_CREATED_OK, $_POST['mod_name']));
+ } else {
+ redirect_header('modules.php', 5, sprintf(_AM_TDMCREATE_MODULE_FORM_UPDATED_OK, $_POST['mod_name']));
+ }
}
- $GLOBALS['xoopsTpl']->assign('error', $obj->getHtmlErrors());
- $form =& $obj->getForm();
+ $GLOBALS['xoopsTpl']->assign('error', $modulesObj->getHtmlErrors());
+ $form =& $modulesObj->getForm();
$GLOBALS['xoopsTpl']->assign('form', $form->render());
break;
@@ -178,24 +183,24 @@
$adminMenu->addItemButton(_AM_TDMCREATE_MODULES_LIST, 'modules.php', 'list');
$GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
- $obj = $tdmcreate->getHandler('modules')->get($mod_id);
- $form = $obj->getForm();
+ $modulesObj = $tdmcreate->getHandler('modules')->get($mod_id);
+ $form = $modulesObj->getForm();
$GLOBALS['xoopsTpl']->assign('form', $form->render());
break;
case 'delete':
- $obj =& $tdmcreate->getHandler('modules')->get($mod_id);
+ $modulesObj =& $tdmcreate->getHandler('modules')->get($mod_id);
if (isset($_REQUEST['ok']) && $_REQUEST['ok'] == 1) {
if ( !$GLOBALS['xoopsSecurity']->check() ) {
redirect_header('modules.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
}
- if ($tdmcreate->getHandler('modules')->delete($obj)) {
+ if ($tdmcreate->getHandler('modules')->delete($modulesObj)) {
redirect_header('modules.php', 3, _AM_TDMCREATE_FORMDELOK);
} else {
- $GLOBALS['xoopsTpl']->assign('error', $obj->getHtmlErrors());
+ $GLOBALS['xoopsTpl']->assign('error', $modulesObj->getHtmlErrors());
}
} else {
- xoops_confirm(array('ok' => 1, 'mod_id' => $mod_id, 'op' => 'delete'), $_SERVER['REQUEST_URI'], sprintf(_AM_TDMCREATE_FORMSUREDEL, $obj->getVar('mod_name')));
+ xoops_confirm(array('ok' => 1, 'mod_id' => $mod_id, 'op' => 'delete'), $_SERVER['REQUEST_URI'], sprintf(_AM_TDMCREATE_FORMSUREDEL, $modulesObj->getVar('mod_name')));
}
break;
@@ -208,21 +213,21 @@
$mod_permissions = XoopsRequest::getInt('mod_permissions');
if ( $mod_id > 0 ) {
- $obj =& $tdmcreate->getHandler('modules')->get($mod_id);
+ $modulesObj =& $tdmcreate->getHandler('modules')->get($mod_id);
if(isset($mod_adminm)) {
- $obj->setVar('mod_admin', $mod_admin);
+ $modulesObj->setVar('mod_admin', $mod_admin);
} elseif(isset($mod_user)) {
- $obj->setVar('mod_user', $mod_user);
+ $modulesObj->setVar('mod_user', $mod_user);
} elseif(isset($mod_search)) {
- $obj->setVar('mod_search', $mod_search);
+ $modulesObj->setVar('mod_search', $mod_search);
} elseif(isset($mod_comments)) {
- $obj->setVar('mod_comments', $mod_comments);
+ $modulesObj->setVar('mod_comments', $mod_comments);
} elseif(isset($mod_notifications)) {
- $obj->setVar('mod_notifications', $mod_notifications);
+ $modulesObj->setVar('mod_notifications', $mod_notifications);
} elseif(isset($mod_permissions)) {
- $obj->setVar('mod_permissions', $mod_permissions);
+ $modulesObj->setVar('mod_permissions', $mod_permissions);
}
- if ($tdmcreate->getHandler('modules')->insert($obj, true)) {
+ 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);
Copied: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/fields.png (from rev 12681, XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/nb_fields.png)
===================================================================
(Binary files differ)
Deleted: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/icons/16/nb_fields.png
===================================================================
(Binary files differ)
Copied: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/xoops_logo.gif (from rev 12681, XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/xoopsdevelopmentteam_logo.gif)
===================================================================
(Binary files differ)
Deleted: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/xoopsdevelopmentteam_logo.gif
===================================================================
(Binary files differ)
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/autoloader.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/autoloader.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/autoloader.php 2014-07-07 14:07:04 UTC (rev 12682)
@@ -0,0 +1,55 @@
+<?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 $
+ */
+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('autoLoader');
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include/update.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include/update.php 2014-07-07 09:44:50 UTC (rev 12681)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include/update.php 2014-07-07 14:07:04 UTC (rev 12682)
@@ -45,7 +45,6 @@
/*
* @public function write
* @param string $module
- * @param mixed $table
* @param string $filename
*/
public function write($module, $filename) {
@@ -54,17 +53,122 @@
}
/*
+ * @private function getIncludeUpdateModule
+ * @param string $moduleDirname
+ * @param mixed $moduleVersion
+ */
+ private function getIncludeUpdateModule($moduleDirname, $moduleVersion)
+ {
+ $ret = <<<EOT
+/**
+ * @param \$module
+ * @param null \$prev_version
+ *
+ * @return bool|null
+ */
+function xoops_module_update_{$moduleDirname}(&\$module, \$prev_version = null)
+{
+ // irmtfan bug fix: solve templates duplicate issue
+ \$ret = null;
+ if (\$prev_version < {$moduleVersion}) {
+ \$ret = update_system_v{$moduleVersion}(\$module);
+ }
+ \$errors = \$module->getErrors();
+ if (!empty(\$errors)) {
+ print_r(\$errors);
+ }
+
+ return \$ret;
+ // irmtfan bug fix: solve templates duplicate issue
+}
+EOT;
+ return $ret;
+ }
+
+ /*
+ * @private function getIncludeUpdateVersion
+ * @param string $moduleDirname
+ * @param mixed $moduleVersion
+ */
+ private function getIncludeUpdateVersion($moduleDirname, $moduleVersion)
+ {
+ $ret = <<<EOT
+// irmtfan bug fix: solve templates duplicate issue
+/**
+ * @param \$module
+ *
+ * @return bool
+ */
+function update_{$moduleDirname}_v{$moduleVersion}(&\$module)
+{
+ global \$xoopsDB;
+ \$result = \$xoopsDB->query(
+ "SELECT t1.tpl_id FROM " . \$xoopsDB->prefix('tplfile') . " t1, " . \$xoopsDB->prefix('tplfile')
+ . " t2 WHERE t1.tpl_refid = t2.tpl_refid AND t1.tpl_module = t2.tpl_module AND t1.tpl_tplset=t2.tpl_tplset AND t1.tpl_file = t2.tpl_file AND t1.tpl_type = t2.tpl_type AND t1.tpl_id > t2.tpl_id"
+ );
+ \$tplids = array();
+ while (list(\$tplid) = \$xoopsDB->fetchRow(\$result)) {
+ \$tplids[] = \$tplid;
+ }
+ if (count(\$tplids) > 0) {
+ \$tplfile_handler =& xoops_gethandler('tplfile');
+ \$duplicate_files = \$tplfile_handler->getObjects(
+ new Criteria('tpl_id', "(" . implode(',', \$tplids) . ")", "IN")
+ );
+
+ if (count(\$duplicate_files) > 0) {
+ foreach (array_keys(\$duplicate_files) as \$i) {
+ \$tplfile_handler->delete(\$duplicate_files[\$i]);
+ }
+ }
+ }
+ \$sql = "SHOW INDEX FROM " . \$xoopsDB->prefix('tplfile') . " WHERE KEY_NAME = 'tpl_refid_module_set_file_type'";
+ if (!\$result = \$xoopsDB->queryF(\$sql)) {
+ xoops_error(\$this->db->error() . '<br />' . \$sql);
+
+ return false;
+ }
+ \$ret = array();
+ while (\$myrow = \$xoopsDB->fetchArray(\$result)) {
+ \$ret[] = \$myrow;
+ }
+ if (!empty(\$ret)) {
+ \$module->setErrors(
+ "'tpl_refid_module_set_file_type' unique index is exist. Note: check 'tplfile' table to be sure this index is UNIQUE because XOOPS CORE need it."
+ );
+
+ return true;
+ }
+ \$sql = "ALTER TABLE " . \$xoopsDB->prefix('tplfile')
+ . " ADD UNIQUE tpl_refid_module_set_file_type ( tpl_refid, tpl_module, tpl_tplset, tpl_file, tpl_type )";
+ if (!\$result = \$xoopsDB->queryF(\$sql)) {
+ xoops_error(\$xoopsDB->error() . '<br />' . \$sql);
+ \$module->setErrors(
+ "'tpl_refid_module_set_file_type' unique index is not added to 'tplfile' table. Warning: do not use XOOPS until you add this unique index."
+ );
+
+ return false;
+ }
+
+ return true;
+}
+// irmtfan bug fix: solve templates duplicate issue
+EOT;
+ return $ret;
+ }
+
+ /*
* @public function renderFile
* @param null
*/
public function renderFile() {
$module = $this->getModule();
$filename = $this->getFileName();
- $moduleDirname = $module->getVar('mod_dirname');
+ $moduleDirname = $module->getVar('mod_dirname');
+ $moduleVersion = str_replace('.', '', $module->getVar('mod_version'));
$content = $this->getHeaderFilesComments($module, $filename);
- $content .= <<<EOT
-\n// ---------- Here your update code ---------- //
-EOT;
+ $content .= $this->getIncludeUpdateModule($moduleDirname, $moduleVersion);
+ $content .= $this->getIncludeUpdateVersion($moduleDirname, $moduleVersion);
//
$this->tdmcfile->create($moduleDirname, 'include', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
return $this->tdmcfile->renderFile();
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/install.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/install.php 2014-07-07 09:44:50 UTC (rev 12681)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/install.php 2014-07-07 14:07:04 UTC (rev 12682)
@@ -21,7 +21,7 @@
$indexFile = XOOPS_UPLOAD_PATH.'/index.html';
$blankFile = XOOPS_UPLOAD_PATH.'/blank.gif';
-$emptyFile = XOOPS_ROOT_PATH.'/modules/TDMCreate/assets/images/empty.png';
+$emptyFile = XOOPS_ROOT_PATH.'/modules/tdmcreate/assets/images/empty.png';
// Making of "uploads" folder
$tdmcreate = XOOPS_UPLOAD_PATH.'/tdmcreate';
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/update.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/update.php 2014-07-07 09:44:50 UTC (rev 12681)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/update.php 2014-07-07 14:07:04 UTC (rev 12682)
@@ -17,4 +17,87 @@
* @since 2.5.0
* @author Txmod Xoops http://www.txmodxoops.org
* @version $Id: update.php 12258 2014-01-02 09:33:29Z timgno $
-*/
\ No newline at end of file
+*/
+
+/**
+ * @param $module
+ * @param null $prev_version
+ *
+ * @return bool|null
+ */
+function xoops_module_update_tdmcreate(&$module, $prev_version = null)
+{
+ // irmtfan bug fix: solve templates duplicate issue
+ $ret = null;
+ if ($prev_version < 191) {
+ $ret = update_system_v191($module);
+ }
+ $errors = $module->getErrors();
+ if (!empty($errors)) {
+ print_r($errors);
+ }
+
+ return $ret;
+ // irmtfan bug fix: solve templates duplicate issue
+}
+
+// irmtfan bug fix: solve templates duplicate issue
+/**
+ * @param $module
+ *
+ * @return bool
+ */
+function update_tdmcreate_v191(&$module)
+{
+ global $xoopsDB;
+ $result = $xoopsDB->query(
+ "SELECT t1.tpl_id FROM " . $xoopsDB->prefix('tplfile') . " t1, " . $xoopsDB->prefix('tplfile')
+ . " t2 WHERE t1.tpl_refid = t2.tpl_refid AND t1.tpl_module = t2.tpl_module AND t1.tpl_tplset=t2.tpl_tplset AND t1.tpl_file = t2.tpl_file AND t1.tpl_type = t2.tpl_type AND t1.tpl_id > t2.tpl_id"
+ );
+ $tplids = array();
+ while (list($tplid) = $xoopsDB->fetchRow($result)) {
+ $tplids[] = $tplid;
+ }
+ if (count($tplids) > 0) {
+ $tplfile_handler =& xoops_gethandler('tplfile');
+ $duplicate_files = $tplfile_handler->getObjects(
+ new Criteria('tpl_id', "(" . implode(',', $tplids) . ")", "IN")
+ );
+
+ if (count($duplicate_files) > 0) {
+ foreach (array_keys($duplicate_files) as $i) {
+ $tplfile_handler->delete($duplicate_files[$i]);
+ }
+ }
+ }
+ $sql = "SHOW INDEX FROM " . $xoopsDB->prefix('tplfile') . " WHERE KEY_NAME = 'tpl_refid_module_set_file_type'";
+ if (!$result = $xoopsDB->queryF($sql)) {
+ xoops_error($this->db->error() . '<br />' . $sql);
+
+ return false;
+ }
+ $ret = array();
+ while ($myrow = $xoopsDB->fetchArray($result)) {
+ $ret[] = $myrow;
+ }
+ if (!empty($ret)) {
+ $module->setErrors(
+ "'tpl_refid_module_set_file_type' unique index is exist. Note: check 'tplfile' table to be sure this index is UNIQUE because XOOPS CORE need it."
+ );
+
+ return true;
+ }
+ $sql = "ALTER TABLE " . $xoopsDB->prefix('tplfile')
+ . " ADD UNIQUE tpl_refid_module_set_file_type ( tpl_refid, tpl_module, tpl_tplset, tpl_file, tpl_type )";
+ if (!$result = $xoopsDB->queryF($sql)) {
+ xoops_error($xoopsDB->error() . '<br />' . $sql);
+ $module->setErrors(
+ "'tpl_refid_module_set_file_type' unique index is not added to 'tplfile' table. Warning: do not use XOOPS until you add this unique index."
+ );
+
+ return false;
+ }
+
+ return true;
+}
+// irmtfan bug fix: solve templates duplicate issue
\ No newline at end of file
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-07 09:44:50 UTC (rev 12681)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/admin.php 2014-07-07 14:07:04 UTC (rev 12682)
@@ -133,7 +133,10 @@
define('_AM_TDMCREATE_MODULE_MIN_XOOPS', "Minimum XOOPS");
define('_AM_TDMCREATE_MODULE_MIN_ADMIN', "Minimum Admin");
define('_AM_TDMCREATE_MODULE_MIN_MYSQL', "Minimum Database");
-
+// Added in version 1.91
+define('_AM_TDMCREATE_MODULE_FORM_CREATED_OK', "The module <b class='green'>%s</b> is successfully created");
+define('_AM_TDMCREATE_MODULE_FORM_UPDATED_OK', "The module <b class='green'>%s</b> is successfully updated");
+// ------------------- Tables --------------------------------- //
//Tables.php
// Buttons
define('_AM_TDMCREATE_ADD_TABLE', "Add new table");
@@ -170,7 +173,7 @@
define('_AM_TDMCREATE_TABLE_PERMISSIONS', "Permissions for this table");
// v1.38
define('_AM_TDMCREATE_TABLE_IMAGE_DESC', "<span class='red bold'>WARNING</span>: If you want to choose a new image, is best to name it with the module name before and follow with the name of the image so as not to overwrite any images with the same name, in the <span class='bold'>Frameworks/moduleclasses/moduleadmin/icons/32/</span>. Otherwise an other solution, would be to insert the images in the module, a new folder is created, with the creation of the same module - <span class='bold'>images/32</span>.");
-define('_AM_TDMCREATE_TABLE_FORM_SAVED_OK', "The table <b class='green'>%s</b> is successfully saved");
+define('_AM_TDMCREATE_TABLE_FORM_CREATED_OK', "The table <b class='green'>%s</b> is successfully created");
define('_AM_TDMCREATE_TABLE_FORM_UPDATED_OK', "The table <b class='green'>%s</b> is successfully updated");
// ------------------ Form Fields ------------------
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/xoops_version.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/xoops_version.php 2014-07-07 09:44:50 UTC (rev 12681)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/xoops_version.php 2014-07-07 14:07:04 UTC (rev 12682)
@@ -90,7 +90,7 @@
$modversion['tables'][9] = "tdmcreate_fieldelements";
// Scripts to run upon installation or update
$modversion['onInstall'] = "include/install.php";
-//$modversion['onUpdate'] = "include/update.php";
+$modversion['onUpdate'] = "include/update.php";
// Menu
$modversion['hasMain'] = 0;
// Config
|
|
From: <txm...@us...> - 2014-07-07 09:45:02
|
Revision: 12681
http://sourceforge.net/p/xoops/svn/12681
Author: txmodxoops
Date: 2014-07-07 09:44:50 +0000 (Mon, 07 Jul 2014)
Log Message:
-----------
- Fixed bug for constant _AM_SYSTEM_MODULES_UNINSTALL
Modified Paths:
--------------
XoopsCore/trunk/htdocs/modules/system/admin/modulesadmin/modulesadmin.php
Modified: XoopsCore/trunk/htdocs/modules/system/admin/modulesadmin/modulesadmin.php
===================================================================
--- XoopsCore/trunk/htdocs/modules/system/admin/modulesadmin/modulesadmin.php 2014-07-07 09:01:29 UTC (rev 12680)
+++ XoopsCore/trunk/htdocs/modules/system/admin/modulesadmin/modulesadmin.php 2014-07-07 09:44:50 UTC (rev 12681)
@@ -488,7 +488,7 @@
} else {
$msgs = array();
$msgs[] = '<div id="xo-module-log"><div class="header">';
- $msgs[] = $errs[] = '<h4>' . _AM_SYSTEM_MODULES_UNINSTAL . $module->getInfo('name', 's') . '</h4>';
+ $msgs[] = $errs[] = '<h4>' . _AM_SYSTEM_MODULES_UNINSTALL . $module->getInfo('name', 's') . '</h4>';
if ($module->getInfo('image') != false && trim($module->getInfo('image')) != '') {
$msgs[] ='<img src="' . XOOPS_URL . '/modules/' . $dirname . '/' . trim($module->getInfo('image')) . '" alt="" />';
}
|
|
From: <txm...@us...> - 2014-07-07 09:01:35
|
Revision: 12680
http://sourceforge.net/p/xoops/svn/12680
Author: txmodxoops
Date: 2014-07-07 09:01:29 +0000 (Mon, 07 Jul 2014)
Log Message:
-----------
- Updated
- Clear unnecessary code
- Still work to do
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/header.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/js/functions.js
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/xoopsversion.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/docs/lang_diff.txt
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/docs/readme.txt
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/common.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/functions.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/update.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/xoops_version.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php 2014-07-05 17:11:09 UTC (rev 12679)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php 2014-07-07 09:01:29 UTC (rev 12680)
@@ -22,24 +22,24 @@
$op = XoopsRequest::getString('op', 'default');
$mid = XoopsRequest::getInt('mod_id');
$moduleObj = $tdmcreate->getHandler('modules')->get( $mid );
-//
+// Switch option
switch ($op) {
case 'build':
$template_main = 'tdmcreate_building.tpl';
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('building.php'));
// Get var module dirname
- $mod_dirname = $moduleObj->getVar('mod_dirname');
+ $moduleDirname = $moduleObj->getVar('mod_dirname');
// Directories for copy from to
- $from_dir = TDMC_UPLOAD_REPOSITORY_PATH.'/'.strtolower($mod_dirname);
- $to_dir = XOOPS_ROOT_PATH.'/modules/'.strtolower($mod_dirname);
- if(isset($mod_dirname)) {
+ $fromDir = TDMC_UPLOAD_REPOSITORY_PATH.'/'.strtolower($moduleDirname);
+ $toDir = XOOPS_ROOT_PATH.'/modules/'.strtolower($moduleDirname);
+ if(isset($moduleDirname)) {
// Clear this module if it's in repository
- if(is_dir($from_dir)) {
- TDMCreate_clearDir($from_dir);
+ if(is_dir($fromDir)) {
+ TDMCreate_clearDir($fromDir);
}
// Clear this module if it's in root/modules
- if(is_dir($to_dir)) {
- TDMCreate_clearDir($to_dir);
+ if(is_dir($toDir)) {
+ TDMCreate_clearDir($toDir);
}
}
// Structure
@@ -65,10 +65,10 @@
}
unset($build);
// Directory to saved all files
- $GLOBALS['xoopsTpl']->assign('building_directory', sprintf(_AM_TDMCREATE_BUILDING_DIRECTORY, $mod_dirname));
+ $GLOBALS['xoopsTpl']->assign('building_directory', sprintf(_AM_TDMCREATE_BUILDING_DIRECTORY, $moduleDirname));
// Copy this module in root modules
- if ( $moduleObj->getVar('mod_inroot_copy') == 1 ) {
- TDMCreate_copyr($from_dir, $to_dir);
+ if( $moduleObj->getVar('mod_inroot_copy') == 1 ) {
+ TDMCreate_copyr($fromDir, $toDir);
}
break;
@@ -77,17 +77,17 @@
$template_main = 'tdmcreate_building.tpl';
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('building.php'));
// Redirect if there aren't modules
- $nb_modules = $tdmcreate->getHandler('modules')->getCount();
- if ( $nb_modules == 0 ) {
+ $nbModules = $tdmcreate->getHandler('modules')->getCount();
+ if( $nbModules == 0 ) {
redirect_header('modules.php?op=new', 2, _AM_TDMCREATE_NOTMODULES );
}
- unset($nb_modules);
+ unset($nbModules);
// Redirect if there aren't tables
- $nb_tables = $tdmcreate->getHandler('tables')->getCount();
- if ($nb_tables == 0) {
+ $nbTables = $tdmcreate->getHandler('tables')->getCount();
+ if($nbTables == 0) {
redirect_header('tables.php?op=new', 2, _AM_TDMCREATE_NOTTABLES );
}
- unset($nb_tables);
+ unset($nbTables);
include_once TDMC_PATH . '/class/building.php';
$handler = TDMCreateBuilding::getInstance();
$form = $handler->getForm();
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/header.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/header.php 2014-07-05 17:11:09 UTC (rev 12679)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/header.php 2014-07-07 09:01:29 UTC (rev 12680)
@@ -20,7 +20,6 @@
*/
include_once dirname(dirname(dirname(dirname(__FILE__)))) . '/include/cp_header.php';
include_once dirname(dirname(__FILE__)) . '/include/common.php';
-include_once dirname(dirname(__FILE__)) . '/include/functions.php';
//
$thisDirname = $GLOBALS['xoopsModule']->getVar('dirname');
// Link System Icons
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php 2014-07-05 17:11:09 UTC (rev 12679)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php 2014-07-07 09:01:29 UTC (rev 12680)
@@ -23,12 +23,12 @@
$op = XoopsRequest::getString('op', 'list');
//
$mod_id = XoopsRequest::getInt('mod_id');
+// Request vars
+$tableId = XoopsRequest::getInt('table_id');
+$tableMid = XoopsRequest::getInt('table_mid');
+$tableNumbFields = XoopsRequest::getInt('table_nbfields');
+$tableFieldname = XoopsRequest::getString('table_fieldname', '');
//
-$table_id = XoopsRequest::getInt('table_id');
-$table_mid = XoopsRequest::getInt('table_mid');
-$table_nbfields = XoopsRequest::getInt('table_nbfields');
-$table_fieldname = XoopsRequest::getString('table_fieldname', '');
-//
switch ($op)
{
case 'list':
@@ -54,21 +54,21 @@
$criteria = new CriteriaCompo();
$criteria->setSort('mod_id ASC, mod_name');
$criteria->setOrder('ASC');
- $nb_modules = $tdmcreate->getHandler('modules')->getCount($criteria);
+ $numbModules = $tdmcreate->getHandler('modules')->getCount($criteria);
// Redirect if there aren't modules
- if ( $nb_modules == 0 ) {
+ if ( $numbModules == 0 ) {
redirect_header('modules.php?op=new', 2, _AM_TDMCREATE_NOTMODULES );
}
$mods_arr = $tdmcreate->getHandler('modules')->getAll($criteria);
unset($criteria);
- $nb_tables = $tdmcreate->getHandler('tables')->getObjects(null);
+ $numbTables = $tdmcreate->getHandler('tables')->getObjects(null);
// Redirect if there aren't tables
- if ($nb_tables == 0) {
+ if ($numbTables == 0) {
redirect_header('tables.php?op=new', 2, _AM_TDMCREATE_NOTTABLES );
}
- unset($nb_tables);
+ unset($numbTables);
// Display modules list
- if ( $nb_modules > 0 )
+ if ( $numbModules > 0 )
{
foreach (array_keys($mods_arr) as $i)
{
@@ -86,13 +86,13 @@
$criteria->add(new Criteria('table_mid', $i));
$criteria->setSort('table_id ASC, table_name');
$criteria->setOrder('ASC');
- $nb_tables = $tdmcreate->getHandler('tables')->getCount($criteria);
+ $numbTables = $tdmcreate->getHandler('tables')->getCount($criteria);
$tables_arr = $tdmcreate->getHandler('tables')->getAll($criteria);
unset($criteria);
// Display tables list
$tables = array();
$lid = 1;
- if ( $nb_tables > 0 )
+ if ( $numbTables > 0 )
{
foreach (array_keys($tables_arr) as $t)
{
@@ -120,9 +120,9 @@
$GLOBALS['xoopsTpl']->append('modules_list', $mod);
unset($mod);
}
- if ( $nb_modules > $limit ) {
+ if ( $numbModules > $limit ) {
include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
- $pagenav = new XoopsPageNav($nb_modules, $limit, $start, 'start', 'op=list&limit=' . $limit);
+ $pagenav = new XoopsPageNav($numbModules, $limit, $start, 'start', 'op=list&limit=' . $limit);
$GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4));
}
} else {
@@ -147,30 +147,30 @@
redirect_header('tables.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
}
$tables =& $tdmcreate->getHandler('tables');
- if (!isset($table_id)) {
+ if (!isset($tableId)) {
// Checking if table name exist
$table_name_search = $tables->getObjects(null);
foreach (array_keys($table_name_search) as $t)
{
if( ($table_name_search[$t]->getVar('table_name') === $_POST['table_name']) &&
- ($table_name_search[$t]->getVar('table_mid') === $table_mid) &&
- ($table_name_search[$t]->getVar('table_id') === $table_id)) {
+ ($table_name_search[$t]->getVar('table_mid') === $tableMid) &&
+ ($table_name_search[$t]->getVar('table_id') === $tableId)) {
redirect_header('tables.php?op=new', 10, sprintf(_AM_TDMCREATE_ERROR_TABLE_NAME_EXIST, $_POST['table_name']));
exit();
}
}
} else {
- if (isset($table_id)) {
- $tablesObj =& $tables->get($table_id);
+ if (isset($tableId)) {
+ $tablesObj =& $tables->get($tableId);
} else {
$tablesObj =& $tables->create();
}
// Form save tables
- $tablesObj->setVars(array('table_mid' => $table_mid,
+ $tablesObj->setVars(array('table_mid' => $tableMid,
'table_name' => $_POST['table_name'],
'table_category' => (($_REQUEST['table_category'] == 1) ? '1' : '0'),
- 'table_nbfields' => $table_nbfields,
- 'table_fieldname' => $table_fieldname));
+ 'table_nbfields' => $tableNumbFields,
+ 'table_fieldname' => $tableFieldname));
//Form table_image
include_once XOOPS_ROOT_PATH.'/class/uploader.php';
$framePathIcon32 = XOOPS_ROOT_PATH . '/Frameworks/moduleclasses/icons/32';
@@ -200,14 +200,14 @@
//
if( $tables->insert($tablesObj) ) {
if( $tablesObj->isNew() ) {
- $table_iid = $GLOBALS['xoopsDB']->getInsertId();
- $table_action='&field_mid='.$table_mid.'&field_tid='.$table_iid.'&field_numb='.$table_nbfields.'&field_name='.$table_fieldname;
+ $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']));
} else {
// Get fields where table id
$fields =& $tdmcreate->getHandler('fields');
- $fieldsObj = $fields->get($table_id);
- $fieldsObj->setVar('field_numb', $table_nbfields);
+ $fieldsObj = $fields->get($tableId);
+ $fieldsObj->setVar('field_numb', $tableNumbFields);
$fields->insert($fieldsObj);
redirect_header('tables.php', 5, sprintf(_AM_TDMCREATE_TABLE_FORM_UPDATED_OK, $_POST['table_name']));
}
@@ -227,13 +227,13 @@
$adminMenu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php?op=list', 'list');
$GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
- $tablesObj = $tdmcreate->getHandler('tables')->get($table_id);
+ $tablesObj = $tdmcreate->getHandler('tables')->get($tableId);
$form = $tablesObj->getForm();
$GLOBALS['xoopsTpl']->assign('form', $form->render());
break;
case 'delete':
- $tablesObj =& $tdmcreate->getHandler('tables')->get($table_id);
+ $tablesObj =& $tdmcreate->getHandler('tables')->get($tableId);
if (isset($_REQUEST['ok']) && $_REQUEST['ok'] == 1) {
if ( !$GLOBALS['xoopsSecurity']->check() ) {
redirect_header('tables.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
@@ -244,38 +244,38 @@
echo $tablesObj->getHtmlErrors();
}
} else {
- xoops_confirm(array('ok' => 1, 'table_id' => $table_id, 'op' => 'delete'), $_SERVER['REQUEST_URI'], sprintf(_AM_TDMCREATE_FORMSUREDEL, $tablesObj->getVar('table_name')));
+ xoops_confirm(array('ok' => 1, 'table_id' => $tableId, 'op' => 'delete'), $_SERVER['REQUEST_URI'], sprintf(_AM_TDMCREATE_FORMSUREDEL, $tablesObj->getVar('table_name')));
}
break;
case 'display':
- $table_blocks = XoopsRequest::getInt('table_blocks');
- $table_admin = XoopsRequest::getInt('table_admin');
- $table_user = XoopsRequest::getInt('table_user');
- $table_submenu = XoopsRequest::getInt('table_submenu');
- $table_search = XoopsRequest::getInt('table_search');
- $table_comments = XoopsRequest::getInt('table_comments');
- $table_notifications = XoopsRequest::getInt('table_notifications');
- $table_permissions = XoopsRequest::getInt('table_permissions');
+ $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 ( $table_id > 0 ) {
- $tablesObj =& $tdmcreate->getHandler('tables')->get($table_id);
- if(isset($table_blocks)) {
- $tablesObj->setVar('table_blocks', $table_blocks);
- } elseif(isset($table_adminm)) {
- $tablesObj->setVar('table_admin', $table_admin);
- } elseif(isset($table_user)) {
- $tablesObj->setVar('table_user', $table_user);
- } elseif(isset($table_submenu)) {
- $tablesObj->setVar('table_submenu', $table_submenu);
- } elseif(isset($table_search)) {
- $tablesObj->setVar('table_search', $table_search);
- } elseif(isset($table_comments)) {
- $tablesObj->setVar('table_comments', $table_comments);
- } elseif(isset($table_notifications)) {
- $tablesObj->setVar('table_notifications', $table_notifications);
- } elseif(isset($table_permissions)) {
- $tablesObj->setVar('table_permissions', $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);
}
if ($tdmcreate->getHandler('tables')->insert($tablesObj, true)) {
redirect_header('modules.php', 1, _AM_TDMCREATE_TOGGLE_SUCCESS);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/js/functions.js
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/js/functions.js 2014-07-05 17:11:09 UTC (rev 12679)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/js/functions.js 2014-07-07 09:01:29 UTC (rev 12680)
@@ -1,31 +1,3 @@
-function addClick(id) {
- var xhr = getXMLHttpRequest(); // Pour récupérer un objet XMLHTTPRequest
- // -- bordel habituel (readyState == 4, etc, etc.)
- xhr.open('GET', 'click.php?id=' + id, true);
- xhr.send(null);
-}
-
-function getXMLHttpRequest() {
- var xhr = null;
-
- if (window.XMLHttpRequest || window.ActiveXObject) {
- if (window.ActiveXObject) {
- try {
- xhr = new ActiveXObject("Msxml2.XMLHTTP");
- } catch (e) {
- xhr = new ActiveXObject("Microsoft.XMLHTTP");
- }
- } else {
- xhr = new XMLHttpRequest();
- }
- } else {
- alert("Votre navigateur ne supporte pas l'objet XMLHTTPRequest...");
- return null;
- }
-
- return xhr;
-}
-
function swapImg(swap) {
obj = document.getElementById(swap);
obj.src = !(obj.src == img_minus) ? img_minus : img_plus;
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-05 17:11:09 UTC (rev 12679)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php 2014-07-07 09:01:29 UTC (rev 12680)
@@ -19,9 +19,8 @@
* @version $Id: architecture.php 12258 2014-01-02 09:33:29Z timgno $
*/
defined('XOOPS_ROOT_PATH') or die('Restricted access');
+include_once TDMC_PATH . '/class/autoloader.php';
require_once 'structure.php';
-/*include_once TDMC_PATH . '/include/functions.php';
-spl_autoload_register('tdmcreateAutoload');*/
class TDMCreateArchitecture extends TDMCreateStructure
{
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-05 17:11:09 UTC (rev 12679)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/xoopsversion.php 2014-07-07 09:01:29 UTC (rev 12680)
@@ -112,11 +112,11 @@
'help' => "page=help",
'license' => "GNU GPL 2.0",
'license_url' => "www.gnu.org/licenses/gpl-2.0.html/",
-
+ //
'release_info' => "{$module->getVar('mod_release_info')}",
'release_file' => XOOPS_URL."/modules/{\$dirname}/docs/{$module->getVar('mod_release_file')}",
'release_date' => "{$date}",
-
+ //
'manual' => "{$module->getVar('mod_manual')}",
'manual_file' => XOOPS_URL."/modules/{\$dirname}/docs/{$module->getVar('mod_manual_file')}",
'min_php' => "{$module->getVar('mod_min_php')}",
@@ -129,6 +129,7 @@
'dirmoduleadmin' => "Frameworks/moduleclasses/moduleadmin",
'sysicons16' => "../../Frameworks/moduleclasses/icons/16",
'sysicons32' => "../../Frameworks/moduleclasses/icons/32",
+ // Local path icons
'modicons16' => "assets/images/icons/16",
'modicons32' => "assets/images/icons/32",
//About
@@ -139,7 +140,7 @@
'module_website_url' => "{$module->getVar('mod_website_url')}",
'module_website_name' => "{$module->getVar('mod_website_name')}",
'release' => "{$module->getVar('mod_release')}",
- 'module_status' => "{$module->getVar('mod_status')}",\n
+ 'module_status' => "{$module->getVar('mod_status')}",\n
EOT;
if (is_object($table)) {
if ( $table->getVar('table_admin') == 1 ) {
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/docs/lang_diff.txt
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/docs/lang_diff.txt 2014-07-05 17:11:09 UTC (rev 12679)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/docs/lang_diff.txt 2014-07-07 09:01:29 UTC (rev 12680)
@@ -1,4 +1,4 @@
Read Me First
=============
-Please make sure that you download the XOOPS Icon Set, and upload it to uploads/images directory
\ No newline at end of file
+To see the differences of language files, see the language folder file name update language 1:59 to 1.91
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/docs/readme.txt
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/docs/readme.txt 2014-07-05 17:11:09 UTC (rev 12679)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/docs/readme.txt 2014-07-07 09:01:29 UTC (rev 12680)
@@ -2,4 +2,16 @@
=============
Please make sure that you download the XOOPS Icon Set, and upload it to uploads/images directory
-Read the table in admin help for the accurate description of the functionality of this module
\ No newline at end of file
+Read the table in admin help for the accurate description of the functionality of this module
+
+Using the new class xoopsrequest.php
+
+Version of xoops
+----------------
+TDMCreate is a module that create other basic modules for CMS Xoops.
+
+Tested with xoops 2.5.7, you can not use it with earlier versions, unless because you do not fit some core files in the background and after some tests.
+
+Now that is ahead xoops versions, and goes to 2.6.0, you should download xoops 2.5.7 and use with this latest version.
+
+Therefore recommended not to use TDMCreate 1.91, with previous versions, to xoops 2.5.7
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/common.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/common.php 2014-07-05 17:11:09 UTC (rev 12679)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/common.php 2014-07-07 09:01:29 UTC (rev 12680)
@@ -38,6 +38,7 @@
define('TDMC_UPLOAD_IMGTAB_URL', TDMC_UPLOAD_URL . '/images/tables' );
// Xoops Request
include_once XOOPS_ROOT_PATH . '/class/xoopsrequest.php';
+include_once TDMC_PATH . '/include/functions.php';
// Include files
$cf = '/class/files/';
$cfa = '/class/files/admin/';
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/functions.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/functions.php 2014-07-05 17:11:09 UTC (rev 12679)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/functions.php 2014-07-07 09:01:29 UTC (rev 12680)
@@ -19,7 +19,15 @@
* @version $Id: functions.php 11084 2013-02-23 15:44:20Z timgno $
*/
defined('XOOPS_ROOT_PATH') or die('Restricted access');
-
+/**
+ * Get Requests
+ *
+ * @param array $global
+ * @param string $key
+ * @param string $default
+ * @param mixed $type
+ * @return mixed Returns string, integer or array
+ */
function TDMCreate_CleanVars( &$global, $key, $default = '', $type = 'int' ) {
switch ( $type ) {
case 'string':
@@ -34,7 +42,12 @@
}
return $ret;
}
-
+/**
+ * Clear directory and its contents
+ *
+ * @param string $folder The contents
+ * @return bool Returns true on success, false on failure
+ */
function TDMCreate_clearDir($folder) {
$opening = @opendir($folder);
if (!$opening) return;
@@ -95,38 +108,8 @@
$dir->close();
return true;
}
-
-function TDMCreate_autoload($classname) {
- foreach($classname as $file) {
- if(file_exists($file)) {
- include_once TDMC_PATH . '/class/files/admin_' . $file . '.php';
- include_once TDMC_PATH . '/class/files/blocks_' . $file . '.php';
- include_once TDMC_PATH . '/class/files/class_' . $file . '.php';
- include_once TDMC_PATH . '/class/files/css_' . $file . '.php';
- include_once TDMC_PATH . '/class/files/docs_' . $file . '.php';
- include_once TDMC_PATH . '/class/files/include_' . $file . '.php';
- include_once TDMC_PATH . '/class/files/language_' . $file . '.php';
- include_once TDMC_PATH . '/class/files/templates_' . $file . '.php';
- include_once TDMC_PATH . '/class/files/user_' . $file . '.php';
- }
- }
-}
-
+//
function UcFirstAndToLower($str)
{
return ucfirst(strtolower(trim($str)));
-}
-
-/*
-if(function_exists(isset($_GET['f']))) { // get function name and parameter $_GET['f']($_GET["p"]);
- include_once TDMC_PATH . '/class/modules.php';
- $ret = TDMCreateModules::createLogo($_GET["iconName"], $_GET["caption"]);
- phpFunction($ret);
-} else {
- echo 'Method Not Exist';
-}
-
-function phpFunction($val='')
-{ // create php function here
- echo $val;
-}*/
\ No newline at end of file
+}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/update.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/update.php 2014-07-05 17:11:09 UTC (rev 12679)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/update.php 2014-07-07 09:01:29 UTC (rev 12680)
@@ -1,22 +1,20 @@
-<?php
+<?php
+/*
+ You may not change or alter any portion of this comment or credits
+ of supporting developers from this source code or any supporting source code
+ 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 By TDM - TEAM DEV MODULE FOR XOOPS
- * - Licence GPL Copyright (c) (http://www.tdmxoops.net)
+ * tdmcreate module
*
- * Cette licence, contient des limitations!!!
- *
- * 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.
- *
- * @license TDM GPL license
- * @author TDM TEAM DEV MODULE
- *
- * ****************************************************************************
- */
-
-?>
\ No newline at end of file
+ * @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: update.php 12258 2014-01-02 09:33:29Z timgno $
+*/
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/xoops_version.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/xoops_version.php 2014-07-05 17:11:09 UTC (rev 12679)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/xoops_version.php 2014-07-07 09:01:29 UTC (rev 12680)
@@ -427,5 +427,5 @@
$modversion['config'][$i]['description'] = "";
$modversion['config'][$i]['formtype'] = "textbox";
$modversion['config'][$i]['valuetype'] = "text";
-$modversion['config'][$i]['default'] = '12670';
+$modversion['config'][$i]['default'] = '12680';
unset($i);
\ No newline at end of file
|
|
From: <txm...@us...> - 2014-07-05 17:11:21
|
Revision: 12679
http://sourceforge.net/p/xoops/svn/12679
Author: txmodxoops
Date: 2014-07-05 17:11:09 +0000 (Sat, 05 Jul 2014)
Log Message:
-----------
- Fixed bugs
- Updated
- Added mod_blocks option
- Still work to do
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/objects.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/classes/formelements.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language/admin.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/language/english/admin.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/modinfo.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/sql/mysql.sql
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/class/files/admin/objects.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/objects.php 2014-07-05 16:13:16 UTC (rev 12678)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/objects.php 2014-07-05 17:11:09 UTC (rev 12679)
@@ -41,6 +41,7 @@
*/
public function getSimpleSetVar($tableName, $fieldName) {
$ret = <<<EOT
+ // Set Var {$fieldName}
\${$tableName}Obj->setVar('{$fieldName}', \$_POST['{$fieldName}']);\n
EOT;
return $ret;
@@ -52,6 +53,7 @@
*/
public function getTextDateSelect($tableName, $fieldName) {
$ret = <<<EOT
+ // Set Var {$fieldName}
\${$tableName}Obj->setVar('{$fieldName}', strtotime(\$_POST['{$fieldName}']));\n
EOT;
return $ret;
@@ -63,6 +65,7 @@
*/
public function getCheckBoxOrRadioYN($tableName, $fieldName) {
$ret = <<<EOT
+ // Set Var {$fieldName}
\${$tableName}Obj->setVar('{$fieldName}', ((\$_REQUEST['{$fieldName}'] == 1) ? '1' : '0'));\n
EOT;
return $ret;
@@ -75,7 +78,7 @@
*/
public function getImageList($moduleDirname, $tableName, $fieldName) {
$ret = <<<EOT
- // Set Var Image
+ // Set Var {$fieldName}
include_once XOOPS_ROOT_PATH.'/class/uploader.php';
\$uploaddir = XOOPS_ROOT_PATH . '/Frameworks/moduleclasses/icons/32';
\$uploader = new XoopsMediaUploader(\$uploaddir, \${$moduleDirname}->getConfig('mimetypes'),
@@ -102,9 +105,9 @@
* @param string $fieldName
*/
public function getUploadImage($moduleDirname, $tableName, $fieldName) {
- $stuModuleDirname = strtolower($moduleDirname);
+ $stuModuleDirname = strtoupper($moduleDirname);
$ret = <<<EOT
- // Set Var Image
+ // Set Var {$fieldName}
include_once XOOPS_ROOT_PATH.'/class/uploader.php';
\$uploaddir = {$stuModuleDirname}_UPLOAD_PATH.'/images/{$tableName}';
\$uploader = new XoopsMediaUploader(\$uploaddir, \${$moduleDirname}->getConfig('mimetypes'),
@@ -131,9 +134,9 @@
* @param string $fieldName
*/
public function getUploadFile($moduleDirname, $tableName, $fieldName) {
- $stuModuleDirname = strtolower($moduleDirname);
+ $stuModuleDirname = strtoupper($moduleDirname);
$ret = <<<EOT
- // Set Var File
+ // Set Var {$fieldName}
include_once XOOPS_ROOT_PATH.'/class/uploader.php';
\$uploaddir = {$stuModuleDirname}_UPLOAD_PATH.'/files/{$tableName}';
\$uploader = new XoopsMediaUploader(\$uploaddir, \${$moduleDirname}->getConfig('mimetypes'),
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-05 16:13:16 UTC (rev 12678)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php 2014-07-05 17:11:09 UTC (rev 12679)
@@ -108,7 +108,6 @@
// Creation of the Directory in repository
$targetDirectory = $this->uploadPath.'/repository/'. $stlModuleDirname;
$uploadImagesFolder = $this->uploadPath.'/images/repository';
-
// Creation of "module" folder
$this->structure->getPath($targetDirectory);
// Creation of "module" folder
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-05 16:13:16 UTC (rev 12678)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/classes/formelements.php 2014-07-05 17:11:09 UTC (rev 12679)
@@ -126,21 +126,8 @@
\$form->addElement( new XoopsFormHidden('{$fieldName}', \$this->getVar('{$fieldName}')) );\n
EOT;
return $ret;
- }
+ }
/*
- * @private function getXoopsFormUploadFile
- * @param string $language
- * @param string $fieldName
- * @param string $required
- */
- private function getXoopsFormUploadFile($language, $moduleDirname, $fieldName, $required = 'false') {
- $ret = <<<EOT
- // Form file
- \$form->addElement( new XoopsFormFile({$language}FORM_UPLOAD_FILE, '{$fieldName}', \$this->{$moduleDirname}->getConfig('maxsize')){$required} );\n
-EOT;
- return $ret;
- }
- /*
* @private function getXoopsFormImageList
* @param string $language
* @param string $moduleDirname
@@ -149,7 +136,8 @@
* @param string $required
*/
private function getXoopsFormImageList($language, $moduleDirname, $tableName, $fieldName, $required = 'false') {
- $stu_field_name = strtoupper($fieldName);
+ $stuTableName = strtoupper($tableName);
+ $stuFieldName = strtoupper($fieldName);
$ret = <<<EOT
// Form image file
\$get_{$fieldName} = \$this->getVar('{$fieldName}');
@@ -158,7 +146,7 @@
\$uploads_dir = '/uploads/'.\$GLOBALS['xoopsModule']->dirname().'/images/{$tableName}';
\$iconsdirectory = is_dir(XOOPS_ROOT_PATH . \$iconsdir) ? \$iconsdir : \$uploads_dir;
//
- \$imgtray1 = new XoopsFormElementTray({$language}{$stu_field_name},'<br />');
+ \$imgtray1 = new XoopsFormElementTray({$language}{$stuFieldName},'<br />');
\$imgpath = is_dir(XOOPS_ROOT_PATH . \$iconsdir) ? sprintf({$language}FORMIMAGE_PATH, ".{\$iconsdir}/") : sprintf({$language}FORMIMAGE_PATH, \$uploads_dir);
//\$imgpath1 = sprintf({$language}FORMIMAGE_PATH, ".{\$iconsdirectory}/");
\$imageselect1 = new XoopsFormSelect(\$imgpath, '{$fieldName}', \${$fieldName}, 10);
@@ -171,7 +159,7 @@
\$imgtray1->addElement( new XoopsFormLabel( '', "<br /><img src='".XOOPS_URL."/".\$iconsdirectory."/".\${$fieldName}."' name='image1' id='image1' alt='' />" ) );
// Form File
\$fileseltray = new XoopsFormElementTray('','<br />');
- \$fileseltray->addElement(new XoopsFormFile({$language}FORM_UPLOAD_IMAGE_LIST , 'attachedfile', \$this->{$moduleDirname}->getConfig('maxsize')));
+ \$fileseltray->addElement(new XoopsFormFile({$language}FORM_UPLOAD_IMAGE_LIST_{$stuTableName} , 'attachedfile', \$this->{$moduleDirname}->getConfig('maxsize')));
\$fileseltray->addElement(new XoopsFormLabel(''));
\$imgtray1->addElement(\$fileseltray);
\$form->addElement( \$imgtray1{$required} );\n
@@ -182,17 +170,35 @@
* @private function getXoopsFormUploadImage
* @param string $language
* @param string $moduleDirname
+ * @param string $tableName
* @param string $required
*/
- private function getXoopsFormUploadImage($language, $moduleDirname, $required = 'false') {
+ private function getXoopsFormUploadImage($language, $moduleDirname, $tableName, $required = 'false') {
+ $stuTableName = strtoupper($tableName);
$ret = <<<EOT
// Form Upload Image
- \$formImage = new XoopsFormFile({$language}FORM_UPLOAD_IMAGE , 'attachedfile', \$this->{$moduleDirname}->getConfig('maxsize'));
+ \$formImage = new XoopsFormFile({$language}FORM_UPLOAD_IMAGE_{$stuTableName} , 'attachedfile', \$this->{$moduleDirname}->getConfig('maxsize'));
\$form->addElement( \$formImage{$required} );\n
EOT;
return $ret;
}
/*
+ * @private function getXoopsFormUploadFile
+ * @param string $language
+ * @param string $moduleDirname
+ * @param string $tableName
+ * @param string $fieldName
+ * @param string $required
+ */
+ private function getXoopsFormUploadFile($language, $moduleDirname, $tableName, $fieldName, $required = 'false') {
+ $stuTableName = strtoupper($tableName);
+ $ret = <<<EOT
+ // Form file
+ \$form->addElement( new XoopsFormFile({$language}FORM_UPLOAD_FILE_{$stuTableName}, '{$fieldName}', \$this->{$moduleDirname}->getConfig('maxsize')){$required} );\n
+EOT;
+ return $ret;
+ }
+ /*
* @private function getXoopsFormColorPicker
* @param string $language
* @param string $fieldName
@@ -380,10 +386,10 @@
$ret .= $this->getXoopsFormImageList($language_funct, $moduleDirname, $tableName, $fieldName, $required);
break;
case 10:
- $ret .= $this->getXoopsFormUploadImage($language_funct, $moduleDirname, $required);
+ $ret .= $this->getXoopsFormUploadImage($language_funct, $moduleDirname, $tableName, $required);
break;
case 11:
- $ret .= $this->getXoopsFormUploadFile($language, $moduleDirname, $fieldName, $required);
+ $ret .= $this->getXoopsFormUploadFile($language, $moduleDirname, $tableName, $fieldName, $required);
break;
case 12:
$ret .= $this->getXoopsFormTextDateSelect($language, $moduleDirname, $fieldName, $required);
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-05 16:13:16 UTC (rev 12678)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language/admin.php 2014-07-05 17:11:09 UTC (rev 12679)
@@ -68,10 +68,10 @@
foreach (array_keys($tables) as $t)
{
$tableName = $tables[$t]->getVar('table_name');
- $stu_table_name = strtoupper($tableName);
- $stl_table_name = strtolower($tableName);
+ $stuTableName = strtoupper($tableName);
+ $stlTableName = strtolower($tableName);
$ret .= <<<EOT
-define('{$language}THEREARE_{$stu_table_name}', "There are <span class='bold'>%s</span> {$stl_table_name} in the database");\n
+define('{$language}THEREARE_{$stuTableName}', "There are <span class='bold'>%s</span> {$stlTableName} in the database");\n
EOT;
}
return $ret;
@@ -90,10 +90,10 @@
foreach (array_keys($tables) as $t)
{
$tableName = $tables[$t]->getVar('table_name');
- $stu_table_name = strtoupper($tableName);
- $stl_table_name = strtolower($tableName);
+ $stuTableName = strtoupper($tableName);
+ $stlTableName = strtolower($tableName);
$ret .= <<<EOT
-define('{$language}THEREARENT_{$stu_table_name}', "There aren't {$stl_table_name}");\n
+define('{$language}THEREARENT_{$stuTableName}', "There aren't {$stlTableName}");\n
EOT;
}
$ret .= <<<EOT
@@ -110,10 +110,10 @@
{
$tableName = $tables[$t]->getVar('table_name');
$tableFieldname = $tables[$t]->getVar('table_fieldname');
- $stu_table_fieldname = strtoupper($tableFieldname);
- $ucf_table_fieldname = ucfirst($tableFieldname);
+ $stuTableFieldname = strtoupper($tableFieldname);
+ $ucfTableFieldname = ucfirst($tableFieldname);
$ret .= <<<EOT
-define('{$language}ADD_{$stu_table_fieldname}', "Add {$ucf_table_fieldname}");\n
+define('{$language}ADD_{$stuTableFieldname}', "Add {$ucfTableFieldname}");\n
EOT;
}
$ret .= <<<EOT
@@ -123,10 +123,10 @@
{
$tableName = $tables[$t]->getVar('table_name');
$tableFieldname = $tables[$t]->getVar('table_fieldname');
- $stu_table_name = strtoupper($tableName);
- $ucf_table_name = ucfirst($tableName);
+ $stuTableName = strtoupper($tableName);
+ $ucfTableName = ucfirst($tableName);
$ret .= <<<EOT
-define('{$language}{$stu_table_name}_LIST', "List of {$ucf_table_name}");\n
+define('{$language}{$stuTableName}_LIST', "List of {$ucfTableName}");\n
EOT;
}
return $ret;
@@ -145,39 +145,39 @@
{
$tableId = $tables[$t]->getVar('table_id');
$tableName = $tables[$t]->getVar('table_name');
- $stu_table_name = strtoupper($tableName);
- $ucf_table_name = ucfirst($tableName);
+ $stuTableName = strtoupper($tableName);
+ $ucfTableName = ucfirst($tableName);
$ret .= <<<EOT
-// {$ucf_table_name} add/edit
-define('{$language}{$stu_table_name}_ADD', "Add {$tableName}");
-define('{$language}{$stu_table_name}_EDIT', "Edit {$tableName}");
-// Elements of {$ucf_table_name}\n
+// {$ucfTableName} add/edit
+define('{$language}{$stuTableName}_ADD', "Add {$tableName}");
+define('{$language}{$stuTableName}_EDIT', "Edit {$tableName}");
+// Elements of {$ucfTableName}\n
EOT;
$fields = $this->getTableFields($tableId);
foreach(array_keys($fields) as $f)
{
$fieldName = $fields[$f]->getVar('field_name');
$fieldElement = $fields[$f]->getVar('field_element');
- $stu_field_name = strtoupper($fieldName);
+ $stuFieldName = strtoupper($fieldName);
$fieldNameDesc = ucfirst(str_replace('_', ' ', $fieldName));
$ret .= <<<EOT
-define('{$language}{$stu_field_name}', "{$fieldNameDesc}");\n
+define('{$language}{$stuFieldName}', "{$fieldNameDesc}");\n
EOT;
switch($fieldElement)
{
case 9:
$ret .= <<<EOT
-define('{$language}FORM_UPLOAD_IMAGE_LIST', "{$fieldNameDesc} in list");\n
+define('{$language}FORM_UPLOAD_IMAGE_LIST_{$stuTableName}', "{$fieldNameDesc} in frameworks images");\n
EOT;
break;
case 10:
$ret .= <<<EOT
-define('{$language}FORM_UPLOAD_IMAGE', "{$fieldNameDesc} in upload");\n
+define('{$language}FORM_UPLOAD_IMAGE_{$stuTableName}', "{$fieldNameDesc} in uploads images");\n
EOT;
break;
case 11:
$ret .= <<<EOT
-define('{$language}FORM_UPLOAD_FILE', "{$fieldNameDesc} in upload");\n
+define('{$language}FORM_UPLOAD_FILE_{$stuTableName}', "{$fieldNameDesc} in uploads files");\n
EOT;
break;
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/modules.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/modules.php 2014-07-05 16:13:16 UTC (rev 12678)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/modules.php 2014-07-05 17:11:09 UTC (rev 12679)
@@ -70,8 +70,9 @@
$this->initVar('mod_website_name',XOBJ_DTYPE_TXTBOX, $this->tdmcreate->getConfig('website_name'));
$this->initVar('mod_release',XOBJ_DTYPE_TXTBOX, $this->tdmcreate->getConfig('release_date'));
$this->initVar('mod_status',XOBJ_DTYPE_TXTBOX, $this->tdmcreate->getConfig('status'));
- $this->initVar('mod_admin',XOBJ_DTYPE_INT, $this->tdmcreate->getConfig('display_admin'));
+ $this->initVar('mod_admin',XOBJ_DTYPE_INT, $this->tdmcreate->getConfig('display_admin'));
$this->initVar('mod_user',XOBJ_DTYPE_INT, $this->tdmcreate->getConfig('display_user'));
+ $this->initVar('mod_blocks',XOBJ_DTYPE_INT, $this->tdmcreate->getConfig('active_blocks'));
$this->initVar('mod_search',XOBJ_DTYPE_INT, $this->tdmcreate->getConfig('active_search'));
$this->initVar('mod_comments',XOBJ_DTYPE_INT, $this->tdmcreate->getConfig('active_comments'));
$this->initVar('mod_notifications', XOBJ_DTYPE_INT, $this->tdmcreate->getConfig('active_notifications'));
@@ -113,30 +114,39 @@
public function getForm($action = false)
{
global $sysPathIcon32;
-
+ //
if ($action === false) {
$action = $_SERVER['REQUEST_URI'];
}
+ //
$isNew = $this->isNew();
$title = $isNew ? sprintf(_AM_TDMCREATE_MODULE_NEW) : sprintf(_AM_TDMCREATE_MODULE_EDIT);
-
+ //
include_once(XOOPS_ROOT_PATH."/class/xoopsformloader.php");
-
+ //
$form = new XoopsThemeForm($title, 'modulesform', $action, 'post', true);
$form->setExtra('enctype="multipart/form-data"');
-
+ //
$form->insertBreak('<div class="center"><b>'._AM_TDMCREATE_MODULE_IMPORTANT.'</b></div>','head');
+ //
$mod_name = new XoopsFormText(_AM_TDMCREATE_MODULE_NAME, 'mod_name', 50, 255, $this->getVar('mod_name'));
$mod_name->setDescription(_AM_TDMCREATE_MODULE_NAME_DESC);
$form->addElement($mod_name, true);
+ //
$mod_dirname = new XoopsFormText(_AM_TDMCREATE_MODULE_DIRNAME, 'mod_dirname', 25, 255, $this->getVar('mod_dirname'));
$mod_dirname->setDescription(_AM_TDMCREATE_MODULE_DIRNAME_DESC);
$form->addElement($mod_dirname, true);
+ //
$form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_VERSION, 'mod_version', 10, 25, $this->getVar('mod_version')), true);
+ //
$form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_SINCE, 'mod_since', 10, 25, $this->getVar('mod_since')), true);
+ //
$form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_MIN_PHP, 'mod_min_php', 10, 25, $this->getVar('mod_min_php')), true);
+ //
$form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_MIN_XOOPS, 'mod_min_xoops', 10, 25, $this->getVar('mod_min_xoops')), true);
+ //
$form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_MIN_ADMIN, 'mod_min_admin', 10, 25, $this->getVar('mod_min_admin')), true);
+ //
$form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_MIN_MYSQL, 'mod_min_mysql', 10, 25, $this->getVar('mod_min_mysql')), true);
// Name description
$editor_configs=array();
@@ -151,27 +161,34 @@
// Author
$form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_AUTHOR, 'mod_author', 50, 255, $this->getVar('mod_author')), true);
$form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_LICENSE, 'mod_license', 50, 255, $this->getVar('mod_license')), true);
+ //
$mod_admin = $isNew ? $this->tdmcreate->getConfig('display_admin') : $this->getVar('mod_admin');
- $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULE_ADMIN, 'mod_admin', $mod_admin, _YES, _NO));
+ $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULE_ADMIN, 'mod_admin', $mod_admin, _YES, _NO), true);
+ //
$mod_user = $isNew ? $this->tdmcreate->getConfig('display_user') : $this->getVar('mod_user');
- $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULE_USER, 'mod_user', $mod_user, _YES, _NO));
+ $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULE_USER, 'mod_user', $mod_user, _YES, _NO), true);
+ //
+ $mod_blocks = $isNew ? $this->tdmcreate->getConfig('active_blocks') : $this->getVar('mod_blocks');
+ $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULE_BLOCKS, 'mod_blocks', $mod_blocks, _YES, _NO), true);
+ //
$mod_search = $isNew ? $this->tdmcreate->getConfig('active_search') : $this->getVar('mod_search');
- $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULE_SEARCH, 'mod_search', $mod_search, _YES, _NO));
+ $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULE_SEARCH, 'mod_search', $mod_search, _YES, _NO), true);
+ //
$mod_comments = $isNew ? $this->tdmcreate->getConfig('active_comments') : $this->getVar('mod_comments');
- $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULE_COMMENTS, 'mod_comments', $mod_comments, _YES, _NO));
-
+ $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULE_COMMENTS, 'mod_comments', $mod_comments, _YES, _NO), true);
+ //
$mod_notifications = $isNew ? $this->tdmcreate->getConfig('active_notifications') : $this->getVar('mod_notifications');
- $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULE_NOTIFICATIONS, 'mod_notifications', $mod_notifications, _YES, _NO));
-
+ $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULE_NOTIFICATIONS, 'mod_notifications', $mod_notifications, _YES, _NO), true);
+ //
$mod_permissions = $isNew ? $this->tdmcreate->getConfig('active_permissions') : $this->getVar('mod_permissions');
- $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULE_PERMISSIONS, 'mod_permissions', $mod_permissions, _YES, _NO));
-
+ $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULE_PERMISSIONS, 'mod_permissions', $mod_permissions, _YES, _NO), true);
+ //
$mod_inroot_copy = $isNew ? $this->tdmcreate->getConfig('inroot_copy') : $this->getVar('mod_inroot_copy');
- $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULE_INROOT_MODULES_COPY, 'mod_inroot_copy', $mod_inroot_copy, _YES, _NO));
-
+ $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULE_INROOT_MODULES_COPY, 'mod_inroot_copy', $mod_inroot_copy, _YES, _NO), true);
+ //
$this_image = $this->getVar('mod_image');
$mod_image = $this_image ? $this_image : 'empty.png';
-
+ //
$uploadirectory = 'uploads/'.$GLOBALS['xoopsModule']->dirname().'/images/repository';
$imgtray = new XoopsFormElementTray(_AM_TDMCREATE_MODULE_IMAGE, '<br />');
$imgpath = sprintf(_AM_TDMCREATE_FORMIMAGE_PATH, './' . strtolower($uploadirectory) . '/');
@@ -183,13 +200,12 @@
$imageselect->setExtra( "onchange='showImgSelected(\"image3\", \"mod_image\", \"" . $uploadirectory . "\", \"\", \"" . XOOPS_URL . "\")'" );
$imgtray->addElement($imageselect);
$imgtray->addElement( new XoopsFormLabel( '', "<br /><img src='" . TDMC_UPLOAD_IMGMOD_URL . "/" . $mod_image . "' name='image3' id='image3' alt='' /><br />" ) );
-
+ //
$fileseltray = new XoopsFormElementTray('', '<br />');
$fileseltray->addElement(new XoopsFormFile(_AM_TDMCREATE_FORMUPLOAD, 'attachedfile', $this->tdmcreate->getConfig('maxsize')));
$fileseltray->addElement(new XoopsFormLabel(''));
$imgtray->addElement($fileseltray);
$form->addElement($imgtray);
-
//---------- START LOGO GENERATOR -----------------
$tables_img = $this->getVar('table_image') ? $this->getVar('table_image') : 'about.png';
$iconsdir = '/Frameworks/moduleclasses/icons/32';
@@ -209,35 +225,52 @@
$iconSelect->setExtra( "onchange='showImgSelected2(\"image4\", \"tables_img\", \"" . $uploadirectory . "\", \"\", \"".XOOPS_URL."\")'" );
$createLogoTray->addElement($iconSelect);
$createLogoTray -> addElement( new XoopsFormLabel( '', "<br /><img src='".XOOPS_URL."/".$uploadirectory."/".$tables_img."' name='image4' id='image4' alt='' />" ) );
-
// Create preview and submit buttons
$buttonLogoGenerator4= new XoopsFormButton('', 'button4', "Create New Logo", 'button');
$buttonLogoGenerator4->setExtra("onclick='createNewModuleLogo(\"" . XOOPS_URL . "\")'");
$createLogoTray->addElement($buttonLogoGenerator4);
-
+ //
$form->addElement($createLogoTray);
//------------ END LOGO GENERATOR --------------------
-
+ //
$form->insertBreak('<div class="center"><b>'._AM_TDMCREATE_MODULE_NOTIMPORTANT.'</b></div>','head');
+ //
$form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_AUTHOR_MAIL, 'mod_author_mail', 50, 255, $this->getVar('mod_author_mail')));
+ //
$form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_AUTHOR_WEBSITE_URL, 'mod_author_website_url', 50, 255, $this->getVar('mod_author_website_url')));
+ //
$form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_AUTHOR_WEBSITE_NAME, 'mod_author_website_name', 50, 255, $this->getVar('mod_author_website_name')));
+ //
$form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_CREDITS, 'mod_credits', 50, 255, $this->getVar('mod_credits')));
+ //
$form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_RELEASE_INFO, 'mod_release_info', 50, 255, $this->getVar('mod_release_info')));
+ //
$form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_RELEASE_FILE, 'mod_release_file', 50, 255, $this->getVar('mod_release_file')));
+ //
$form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_MANUAL, 'mod_manual', 50, 255, $this->getVar('mod_manual')));
+ //
$form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_MANUAL_FILE, 'mod_manual_file', 50, 255, $this->getVar('mod_manual_file')));
+ //
$form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_DEMO_SITE_URL, 'mod_demo_site_url', 50, 255, $this->getVar('mod_demo_site_url')));
+ //
$form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_DEMO_SITE_NAME, 'mod_demo_site_name', 50, 255, $this->getVar('mod_demo_site_name')));
+ //
$form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_SUPPORT_URL, 'mod_support_url', 50, 255, $this->getVar('mod_support_url')));
- $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_SUPPORT_NAME, 'mod_support_name', 50, 255, $this->getVar('mod_support_name')));
- $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_WEBSITE_URL, 'mod_website_url', 50, 255, $this->getVar('mod_website_url')));
+ //
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_SUPPORT_NAME, 'mod_support_name', 50, 255, $this->getVar('mod_support_name')));
+ //
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_WEBSITE_URL, 'mod_website_url', 50, 255, $this->getVar('mod_website_url')));
+ //
$form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_WEBSITE_NAME, 'mod_website_name', 50, 255, $this->getVar('mod_website_name')));
+ //
$form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_RELEASE, 'mod_release', 50, 255, $this->getVar('mod_release')));
+ //
$form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_STATUS, 'mod_status', 50, 255, $this->getVar('mod_status')));
+ //
$form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_PAYPAL_BUTTON, 'mod_donations', 50, 255, $this->getVar('mod_donations')));
+ //
$form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_SUBVERSION, 'mod_subversion', 50, 255, $this->getVar('mod_subversion')));
-
+ //
$form->addElement(new XoopsFormHidden('op', 'save'));
$form->addElement(new XoopsFormButton(_REQUIRED.' <span class="red bold">*</span>', 'submit', _SUBMIT, 'submit'));
return $form;
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tables.php 2014-07-05 16:13:16 UTC (rev 12678)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tables.php 2014-07-05 17:11:09 UTC (rev 12679)
@@ -140,20 +140,10 @@
$get_table_image = $this->getVar('table_image');
$table_image = $get_table_image ? $get_table_image : 'blank.gif';
$iconsdir = '/Frameworks/moduleclasses/icons/32';
- $uploads_dir = '/uploads/tdmcreate/images/tables';
- if(is_dir(XOOPS_ROOT_PATH . $iconsdir)){
- $iconsdirectory = $iconsdir;
- }else{
- $iconsdirectory = $uploads_dir;
- }
- /*$iconsdirectory = $isNew ? $iconsdir : $uploads_dir;*/
+ $uploads_dir = '/uploads/tdmcreate/images/tables';
+ $iconsdirectory = is_dir(XOOPS_ROOT_PATH . $iconsdir) ? $iconsdir : $uploads_dir;
//
- $imgtray1 = new XoopsFormElementTray(_AM_TDMCREATE_TABLE_IMAGE,'<br />');
- if(is_dir(XOOPS_ROOT_PATH . $iconsdir)) {
- $imgpath = sprintf(_AM_TDMCREATE_FORMIMAGE_PATH, ".{$iconsdir}/");
- }else{
- $imgpath = sprintf(_AM_TDMCREATE_FORMIMAGE_PATH, $uploads_dir);
- }
+ $imgtray1 = new XoopsFormElementTray(_AM_TDMCREATE_TABLE_IMAGE,'<br />');
$imgpath1 = sprintf(_AM_TDMCREATE_FORMIMAGE_PATH, ".{$iconsdirectory}/");
$imageselect1 = new XoopsFormSelect($imgpath1, 'table_image', $table_image, 10);
$image_array1 = XoopsLists::getImgListAsArray( XOOPS_ROOT_PATH . $iconsdirectory );
@@ -176,57 +166,73 @@
$form->addElement($check_table_autoincrement);
//
$options_tray = new XoopsFormElementTray(_OPTIONS, '<br />');
- $table_blocks = $isNew ? 0 : $this->getVar('table_blocks');
- $check_table_blocks = new XoopsFormCheckBox(' ', 'table_blocks', $table_blocks);
- $check_table_blocks->addOption(1, _AM_TDMCREATE_TABLE_BLOCKS);
- $options_tray->addElement($check_table_blocks);
- //
- $table_admin = $isNew ? 0 : $this->getVar('table_admin');
- $check_table_admin = new XoopsFormCheckBox(' ', 'table_admin', $table_admin);
- $check_table_admin->addOption(1, _AM_TDMCREATE_TABLE_ADMIN);
- $options_tray->addElement($check_table_admin);
- //
- $table_user = $isNew ? 0 : $this->getVar('table_user');
- $check_table_user = new XoopsFormCheckBox(' ', 'table_user', $table_user);
- $check_table_user->addOption(1, _AM_TDMCREATE_TABLE_USER);
- $options_tray->addElement($check_table_user);
- //
- $table_submenu = $isNew ? 0 : $this->getVar('table_submenu');
- $check_table_submenu = new XoopsFormCheckBox(' ', 'table_submenu', $table_submenu);
- $check_table_submenu->addOption(1, _AM_TDMCREATE_TABLE_SUBMENU);
- $options_tray->addElement($check_table_submenu);
- //
+ //
+ $table_blocks = $isNew ? 0 : $this->getVar('table_blocks');
+ $check_table_blocks = new XoopsFormCheckBox(' ', 'table_blocks', $table_blocks);
+ $check_table_blocks->addOption(1, _AM_TDMCREATE_TABLE_BLOCKS);
+ $options_tray->addElement($check_table_blocks);
+ //
+ $table_admin = $isNew ? 0 : $this->getVar('table_admin');
+ $check_table_admin = new XoopsFormCheckBox(' ', 'table_admin', $table_admin);
+ $check_table_admin->addOption(1, _AM_TDMCREATE_TABLE_ADMIN);
+ $options_tray->addElement($check_table_admin);
+ //
+ $table_user = $isNew ? 0 : $this->getVar('table_user');
+ $check_table_user = new XoopsFormCheckBox(' ', 'table_user', $table_user);
+ $check_table_user->addOption(1, _AM_TDMCREATE_TABLE_USER);
+ $options_tray->addElement($check_table_user);
+ //
+ $table_submenu = $isNew ? 0 : $this->getVar('table_submenu');
+ $check_table_submenu = new XoopsFormCheckBox(' ', 'table_submenu', $table_submenu);
+ $check_table_submenu->addOption(1, _AM_TDMCREATE_TABLE_SUBMENU);
+ $options_tray->addElement($check_table_submenu);
+ //
+ $criteria = new CriteriaCompo(new Criteria('table_search', ($isNew ? 0 : 1)), 'AND');
+ $criteria->add(new Criteria('table_mid', $table_mid), 'AND');
+ $criteria->add(new Criteria('table_name', $table_name));
+ $table_comments = $tablesHandler->getCount($criteria);
+ unset($criteria);
+ if( ($table_comments == 0) || $isNew ) {
$table_search = $isNew ? 0 : $this->getVar('table_search');
$check_table_search = new XoopsFormCheckBox(' ', 'table_search', $table_search);
$check_table_search->addOption(1, _AM_TDMCREATE_TABLE_SEARCH);
$options_tray->addElement($check_table_search);
- //
+ }
+ //
+ $criteria = new CriteriaCompo(new Criteria('table_comments', ($isNew ? 0 : 1)), 'AND');
+ $criteria->add(new Criteria('table_mid', $table_mid), 'AND');
+ $criteria->add(new Criteria('table_name', $table_name));
+ $table_comments = $tablesHandler->getCount($criteria);
+ unset($criteria);
+ if ( ($table_comments == 0) || $isNew ) {
$table_comments = $isNew ? 0 : $this->getVar('table_comments');
$check_table_comments = new XoopsFormCheckBox(' ', 'table_comments', $table_comments);
$check_table_comments->addOption(1, _AM_TDMCREATE_TABLE_COMMENTS);
$options_tray->addElement($check_table_comments);
- //
- $table_notifications = $isNew ? 0 : $this->getVar('table_notifications');
- $check_table_notifications = new XoopsFormCheckBox(' ', 'table_notifications', $table_notifications);
- $check_table_notifications->addOption(1, _AM_TDMCREATE_TABLE_NOTIFICATIONS);
- $options_tray->addElement($check_table_notifications);
- //
- $criteria = new CriteriaCompo(new Criteria('table_permissions', 0), 'AND');
- $criteria->add(new Criteria('table_mid', $table_mid), 'AND');
- $criteria->add(new Criteria('table_name', $table_name));
- $table_permissions = $tablesHandler->getCount($criteria);
- unset($criteria);
- if ( ($table_permissions == 0) && ($table_category == 0) || $isNew ) {
- $table_permissions = $isNew ? 0 : $this->getVar('table_permissions');
- $check_table_permissions = new XoopsFormCheckBox(' ', 'table_permissions', $table_permissions);
- $check_table_permissions->addOption(1, _AM_TDMCREATE_TABLE_PERMISSIONS);
- $options_tray->addElement($check_table_permissions);
- }
+ }
+ //
+ $table_notifications = $isNew ? 0 : $this->getVar('table_notifications');
+ $check_table_notifications = new XoopsFormCheckBox(' ', 'table_notifications', $table_notifications);
+ $check_table_notifications->addOption(1, _AM_TDMCREATE_TABLE_NOTIFICATIONS);
+ $options_tray->addElement($check_table_notifications);
+ //
+ $criteria = new CriteriaCompo(new Criteria('table_permissions', ($isNew ? 0 : 1)), 'AND');
+ $criteria->add(new Criteria('table_mid', $table_mid), 'AND');
+ $criteria->add(new Criteria('table_name', $table_name));
+ $table_permissions = $tablesHandler->getCount($criteria);
+ unset($criteria);
+ if ( ($table_permissions == 0) && ($table_category == 0) || $isNew ) {
+ $table_permissions = $isNew ? 0 : $this->getVar('table_permissions');
+ $check_table_permissions = new XoopsFormCheckBox(' ', 'table_permissions', $table_permissions);
+ $check_table_permissions->addOption(1, _AM_TDMCREATE_TABLE_PERMISSIONS);
+ $options_tray->addElement($check_table_permissions);
+ }
$options_tray->setDescription(_AM_TDMCREATE_TABLE_OPTIONS_CHECKS_DESC);
+ //
$form->addElement($options_tray);
//
$form->addElement(new XoopsFormHidden('op', 'save'));
- $form->addElement(new XoopsFormHidden('table_id', $this->getVar('table_id')));
+ $form->addElement(new XoopsFormHidden('table_id', ($isNew ? 0 : $this->getVar('table_id'))));
$form->addElement(new XoopsFormButton(_REQUIRED.' <sup class="red bold">*</sup>', 'submit', _SUBMIT, 'submit'));
return $form;
}
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-05 16:13:16 UTC (rev 12678)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/admin.php 2014-07-05 17:11:09 UTC (rev 12679)
@@ -78,7 +78,9 @@
define('_AM_TDMCREATE_MODULE_NAME', "Name");
define('_AM_TDMCREATE_MODULE_NAME_DESC', "The module name can contain spaces and special characters such as accents.<br />
An example would be: <b class='white'>My Simple Module</b>");
+// Added in version 1.91
define('_AM_TDMCREATE_MODULE_DIRNAME', "Directory Name");
+// ---------------------
define('_AM_TDMCREATE_MODULE_DIRNAME_DESC', "The module directory can not contain spaces or special characters such as accents.<br />
An example would be: <b class='white'>mysimplemodule</b>.<br />In case you write the module directory with uppercase characters, they are replaced automatically with lowercase, and if there are spaces they will also be automatically deleted.");
define('_AM_TDMCREATE_MODULE_VERSION', "Version");
@@ -107,14 +109,19 @@
define('_AM_TDMCREATE_MODULE_SUBVERSION', "Subversion module");
define('_AM_TDMCREATE_MODULE_ADMIN', "Visible Admin");
define('_AM_TDMCREATE_MODULE_USER', "Visible User");
-define('_AM_TDMCREATE_MODULE_SEARCH', "Enable Search");
-define('_AM_TDMCREATE_MODULE_COMMENTS', "Enable Comments");
-define('_AM_TDMCREATE_MODULE_NOTIFICATIONS', "Enable Notifications");
-define('_AM_TDMCREATE_MODULE_PERMISSIONS', "Enable Permissions");
-define('_AM_TDMCREATE_MODULE_INROOT_COPY', "Copy this module also in root/modules?");
+// Added in version 1.91
+define('_AM_TDMCREATE_MODULE_BLOCKS', "Activate Blocks");
+// ---------------------
+define('_AM_TDMCREATE_MODULE_SEARCH', "Activate Search");
+define('_AM_TDMCREATE_MODULE_COMMENTS', "Activate Comments");
+define('_AM_TDMCREATE_MODULE_NOTIFICATIONS', "Activate Notifications");
+define('_AM_TDMCREATE_MODULE_PERMISSIONS', "Activate Permissions");
+define('_AM_TDMCREATE_MODULE_INROOT_MODULES_COPY', "Copy of this module directly in root/modules?");
// Added in version 1.39
-define('_AM_TDMCREATE_MODULE_NBFIELDS', "Fields");
-define('_AM_TDMCREATE_MODULE_BLOCKS', "Blocks");
+define('_AM_TDMCREATE_MODULE_NAME_LIST', "Name");
+define('_AM_TDMCREATE_MODULE_IMAGE_LIST', "Image");
+define('_AM_TDMCREATE_MODULE_NBFIELDS_LIST', "Fields");
+define('_AM_TDMCREATE_MODULE_BLOCKS_LIST', "Blocks");
define('_AM_TDMCREATE_MODULE_ADMIN_LIST', "Admin");
define('_AM_TDMCREATE_MODULE_USER_LIST', "User");
define('_AM_TDMCREATE_MODULE_SUBMENU_LIST', "Submenu");
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/modinfo.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/modinfo.php 2014-07-05 16:13:16 UTC (rev 12678)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/modinfo.php 2014-07-05 17:11:09 UTC (rev 12679)
@@ -61,6 +61,9 @@
define('_MI_TDMCREATE_STATUS', "Module status");
define('_MI_TDMCREATE_DISPLAY_ADMIN_SIDE', "Visible in Admin Panel");
define('_MI_TDMCREATE_DISPLAY_USER_SIDE', "Visible in User side");
+// Added in version 1.91
+define('_MI_TDMCREATE_ACTIVE_BLOCKS', "Allow Blocks");
+// ---------------------
define('_MI_TDMCREATE_ACTIVE_SEARCH', "Allow Search");
define('_MI_TDMCREATE_ACTIVE_COMMENTS', "Allow Comments");
define('_MI_TDMCREATE_ACTIVE_NOTIFICATIONS', "Allow notifications");
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/sql/mysql.sql
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/sql/mysql.sql 2014-07-05 16:13:16 UTC (rev 12678)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/sql/mysql.sql 2014-07-05 17:11:09 UTC (rev 12679)
@@ -41,8 +41,9 @@
`mod_website_name` VARCHAR(255) NOT NULL DEFAULT '',
`mod_release` VARCHAR(11) NOT NULL DEFAULT '00-00-0000',
`mod_status` VARCHAR(150) NOT NULL DEFAULT 'Beta 1',
- `mod_admin` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1',
+ `mod_admin` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1',
`mod_user` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1',
+ `mod_blocks` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
`mod_search` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
`mod_comments` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
`mod_notifications` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
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-05 16:13:16 UTC (rev 12678)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_tables.tpl 2014-07-05 17:11:09 UTC (rev 12679)
@@ -10,10 +10,10 @@
<thead>
<tr>
<th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_ID}></th>
- <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_NAME}></th>
- <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_IMAGE}></th>
- <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_NBFIELDS}></th>
- <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_BLOCKS}></th>
+ <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_NAME_LIST}></th>
+ <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_IMAGE_LIST}></th>
+ <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_NBFIELDS_LIST}></th>
+ <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_BLOCKS_LIST}></th>
<th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_ADMIN_LIST}></th>
<th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_USER_LIST}></th>
<th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_SUBMENU_LIST}></th>
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/xoops_version.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/xoops_version.php 2014-07-05 16:13:16 UTC (rev 12678)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/xoops_version.php 2014-07-05 17:11:09 UTC (rev 12679)
@@ -240,6 +240,13 @@
$modversion['config'][$i]['valuetype'] = "int";
$modversion['config'][$i]['default'] = 1;
$i++;
+$modversion['config'][$i]['name'] = "active_blocks";
+$modversion['config'][$i]['title'] = "_MI_TDMCREATE_ACTIVE_BLOCKS";
+$modversion['config'][$i]['description'] = "";
+$modversion['config'][$i]['formtype'] = "yesno";
+$modversion['config'][$i]['valuetype'] = "int";
+$modversion['config'][$i]['default'] = 0;
+$i++;
$modversion['config'][$i]['name'] = "active_search";
$modversion['config'][$i]['title'] = "_MI_TDMCREATE_ACTIVE_SEARCH";
$modversion['config'][$i]['description'] = "";
|
|
From: <go...@us...> - 2014-07-05 16:13:19
|
Revision: 12678
http://sourceforge.net/p/xoops/svn/12678
Author: goffy
Date: 2014-07-05 16:13:16 +0000 (Sat, 05 Jul 2014)
Log Message:
-----------
corrected check of right for reading newsletters
Modified Paths:
--------------
XoopsModules/xnewsletter/branches/mamba/xnewsletter/blocks/blocks_letter.php
Modified: XoopsModules/xnewsletter/branches/mamba/xnewsletter/blocks/blocks_letter.php
===================================================================
--- XoopsModules/xnewsletter/branches/mamba/xnewsletter/blocks/blocks_letter.php 2014-07-05 16:11:49 UTC (rev 12677)
+++ XoopsModules/xnewsletter/branches/mamba/xnewsletter/blocks/blocks_letter.php 2014-07-05 16:13:16 UTC (rev 12678)
@@ -83,7 +83,7 @@
$letter_cat_arr = explode('|', $letterObj->getVar('letter_cats'));
$showCat = false;
foreach (array_keys($letter_cat_arr) as $cat_id) {
- $showCat = $gperm_handler->checkRight('newsletter_create_cat', $cat_id, $my_group_ids, $xnewsletter->getModule()->mid());
+ $showCat = $gperm_handler->checkRight('newsletter_read_cat', $cat_id, $my_group_ids, $xnewsletter->getModule()->mid());
if ($showCat == true) {
$letter[$letter_id]['letter_id'] = $letterObj->getVar('letter_id');
$letter_title = $letterObj->getVar('letter_title');
|
|
From: <go...@us...> - 2014-07-05 16:11:56
|
Revision: 12677
http://sourceforge.net/p/xoops/svn/12677
Author: goffy
Date: 2014-07-05 16:11:49 +0000 (Sat, 05 Jul 2014)
Log Message:
-----------
corrected check of right for reading newsletters
Modified Paths:
--------------
XoopsModules/xnewsletter/branches/luciorota/xNewsletter/blocks/blocks_letter.php
Modified: XoopsModules/xnewsletter/branches/luciorota/xNewsletter/blocks/blocks_letter.php
===================================================================
--- XoopsModules/xnewsletter/branches/luciorota/xNewsletter/blocks/blocks_letter.php 2014-07-05 16:09:56 UTC (rev 12676)
+++ XoopsModules/xnewsletter/branches/luciorota/xNewsletter/blocks/blocks_letter.php 2014-07-05 16:11:49 UTC (rev 12677)
@@ -78,7 +78,7 @@
$letter_cat_arr = explode('|', $letter_arr[$i]->getVar('letter_cats'));
$showCat = false;
foreach (array_keys($letter_cat_arr) as $cat_id) {
- $showCat = $gperm_handler->checkRight('newsletter_create_cat', $cat_id, $my_group_ids, $xnewsletter->getModule()->mid());
+ $showCat = $gperm_handler->checkRight('newsletter_read_cat', $cat_id, $my_group_ids, $xnewsletter->getModule()->mid());
if ($showCat == true) {
$letter[$i]['letter_id'] = $letter_arr[$i]->getVar('letter_id');
$letter_title = $letter_arr[$i]->getVar('letter_title');
|
|
From: <go...@us...> - 2014-07-05 16:10:02
|
Revision: 12676
http://sourceforge.net/p/xoops/svn/12676
Author: goffy
Date: 2014-07-05 16:09:56 +0000 (Sat, 05 Jul 2014)
Log Message:
-----------
corrected check of right for reading newsletters
Modified Paths:
--------------
XoopsModules/xnewsletter/trunk/xNewsletter/blocks/blocks_letter.php
Modified: XoopsModules/xnewsletter/trunk/xNewsletter/blocks/blocks_letter.php
===================================================================
--- XoopsModules/xnewsletter/trunk/xNewsletter/blocks/blocks_letter.php 2014-07-05 08:07:11 UTC (rev 12675)
+++ XoopsModules/xnewsletter/trunk/xNewsletter/blocks/blocks_letter.php 2014-07-05 16:09:56 UTC (rev 12676)
@@ -86,7 +86,7 @@
$letter_cat_arr = explode("|", $letter_arr[$i]->getVar("letter_cats"));
$showcat = 0;
foreach (array_keys($letter_cat_arr) as $cat_id) {
- $showcat = $gperm_handler->checkRight( 'newsletter_create_cat', $cat_id, $my_group_ids, $mid ) ;
+ $showcat = $gperm_handler->checkRight( 'newsletter_read_cat', $cat_id, $my_group_ids, $mid ) ;
if ($showcat == 1 ) {
$letter[$i]["letter_id"] = $letter_arr[$i]->getVar("letter_id");
$letter_title = $letter_arr[$i]->getVar("letter_title");
|
|
From: <txm...@us...> - 2014-07-05 08:07:20
|
Revision: 12675
http://sourceforge.net/p/xoops/svn/12675
Author: txmodxoops
Date: 2014-07-05 08:07:11 +0000 (Sat, 05 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/menu.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/classes/formelements.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language/admin.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/admin/pages.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php 2014-07-04 09:29:45 UTC (rev 12674)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php 2014-07-05 08:07:11 UTC (rev 12675)
@@ -23,13 +23,13 @@
$op = XoopsRequest::getString('op', 'list');
// Get fields Variables
$field_mid = TDMCreate_CleanVars($_REQUEST, 'field_mid');
-$field_tid = TDMCreate_CleanVars($_REQUEST, 'field_tid');
-$field_numb = TDMCreate_CleanVars($_REQUEST, 'field_numb');
-$field_name = TDMCreate_CleanVars($_REQUEST, 'field_name', '', 'string');/**/
+$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');
-$field_tid = XoopsRequest::getInt('field_tid');
-$field_numb = XoopsRequest::getInt('field_numb');
-$field_name = XoopsRequest::getString('field_name', ''); */
+$fieldTid = XoopsRequest::getInt('field_tid');
+$fieldNumb = XoopsRequest::getInt('field_numb');
+$fieldName = XoopsRequest::getString('field_name', ''); */
//
switch ($op)
{
@@ -144,13 +144,13 @@
$GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
// Form Add
$fieldsObj =& $tdmcreate->getHandler('fields')->create();
- $form = $fieldsObj->getFormNew($field_mid, $field_tid, $field_numb, $field_name);
+ $form = $fieldsObj->getFormNew($field_mid, $fieldTid, $fieldNumb, $fieldName);
$GLOBALS['xoopsTpl']->assign('form', $form->render());
// Test -> Will be removed
var_dump($field_mid);
- var_dump($field_tid);
- var_dump($field_numb);
- var_dump($field_name);
+ var_dump($fieldTid);
+ var_dump($fieldNumb);
+ var_dump($fieldName);
break;
case 'save':
@@ -172,11 +172,11 @@
$fieldsObj =& $fields->get($value);
break;
}
- if (isset($field_mid) && isset($field_tid) && !empty($_POST['field_name'][$key])) {
+ if (isset($field_mid) && isset($fieldTid) && !empty($_POST['field_name'][$key])) {
// Set Data
$fieldsObj->setVar( 'field_mid', $field_mid );
- $fieldsObj->setVar( 'field_tid', $field_tid );
- $fieldsObj->setVar( 'field_numb', $field_numb );
+ $fieldsObj->setVar( 'field_tid', $fieldTid );
+ $fieldsObj->setVar( 'field_numb', $fieldNumb );
$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] : '') );
@@ -199,14 +199,14 @@
}
}
// Get table name from field table id
- $tables =& $tdmcreate->getHandler('tables')->get($field_tid);
+ $tables =& $tdmcreate->getHandler('tables')->get($fieldTid);
$table_name = $tables->getVar('table_name');
// Set field elements
if ($fieldsObj->isNew()) {
// Fields Elements Handler
$fieldelementObj =& $tdmcreate->getHandler('fieldelements')->create();
$fieldelementObj->setVar( 'fieldelement_mid', $field_mid );
- $fieldelementObj->setVar( 'fieldelement_tid', $field_tid );
+ $fieldelementObj->setVar( 'fieldelement_tid', $fieldTid );
$fieldelementObj->setVar( 'fieldelement_name', 'Table : '.ucfirst($table_name) );
$fieldelementObj->setVar( 'fieldelement_value', 'XoopsFormTables-'.ucfirst($table_name) );
// Insert new field element id for table name
@@ -219,7 +219,7 @@
}
//
$GLOBALS['xoopsTpl']->assign('error', $fieldsObj->getHtmlErrors());
- $form = $fieldsObj->getForm(null, $field_tid);
+ $form = $fieldsObj->getForm(null, $fieldTid);
$GLOBALS['xoopsTpl']->assign('form', $form->render());
break;
@@ -234,10 +234,10 @@
// Form Edit
$field_id = XoopsRequest::getInt('field_id');
$fieldsObj = $tdmcreate->getHandler('fields')->get( $field_id );
- $form = $fieldsObj->getFormEdit($field_mid, $field_tid);
+ $form = $fieldsObj->getFormEdit($field_mid, $fieldTid);
$GLOBALS['xoopsTpl']->assign('form', $form->render());
// Test -> Will be removed
- var_dump($field_tid);
+ var_dump($fieldTid);
break;
case 'drag':
@@ -273,7 +273,7 @@
case 'display':
// Get the list of fields
$criteria = new CriteriaCompo();
- $criteria->add(new Criteria('field_tid', $field_tid));
+ $criteria->add(new Criteria('field_tid', $fieldTid));
$fields = $tdmcreate->getHandler('fields')->getObjects($criteria);
$fieldsObj =& $tdmcreate->getHandler('fields')->get($field_id);
if (isset($_GET['field_tid'])) {
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-04 09:29:45 UTC (rev 12674)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/menu.php 2014-07-05 08:07:11 UTC (rev 12675)
@@ -45,7 +45,6 @@
/*
* @public function write
* @param string $module
- * @param mixed $table
* @param mixed $tables
* @param string $filename
*/
@@ -55,23 +54,55 @@
$this->setFileName($filename);
}
/*
- * @private function getAdminMenuPath
+ * @private function getAdminMenuHeader
+ * @param null
+ */
+ private function getAdminMenuHeader() {
+ $ret = <<<EOT
+\$dirname = basename( dirname( dirname( __FILE__ ) ) ) ;
+\$module_handler =& xoops_gethandler('module');
+\$xoopsModule =& XoopsModule::getByDirname(\$dirname);
+\$moduleInfo =& \$module_handler->get(\$xoopsModule->getVar('mid'));
+\$sysPathIcon32 = \$moduleInfo->getInfo('sysicons32');\n
+EOT;
+ return $ret;
+ }
+ /*
+ * @private function getAdminMenuDashboard
+ * @param string $language
+ * @param integer $menu
+ */
+ private function getAdminMenuDashboard($language, $menu) {
+ $ret = <<<EOT
+\$i = 1;
+\$adminmenu[\$i]['title'] = {$language}{$menu};
+\$adminmenu[\$i]['link'] = 'admin/index.php';
+\$adminmenu[\$i]['icon'] = \$sysPathIcon32.'/dashboard.png';
+\$i++;\n
+EOT;
+ return $ret;
+ }
+ /*
+ * @private function getAdminMenuImagesPath
* @param array $tables
* @param integer $t
*/
- private function getAdminMenuPath($tables, $t) {
+ private function getAdminMenuImagesPath($tables, $t) {
$fields = $this->getTableFields($tables[$t]->getVar('table_id'));
foreach (array_keys($fields) as $f)
{
$fieldElement = $fields[$f]->getVar('field_element');
- if( ($fieldElement == 9) || ( $fieldElement != 10 ) ) {
- $ret = <<<EOT
+ switch( $fieldElement ) {
+ case 10:
+ $ret = <<<EOT
+\$adminmenu[\$i]['icon'] = 'assets/images/icons/32/{$tables[$t]->getVar('table_image')}';\n
+EOT;
+ break;
+ default:
+ $ret = <<<EOT
\$adminmenu[\$i]['icon'] = \$sysPathIcon32.'/{$tables[$t]->getVar('table_image')}';\n
EOT;
- } elseif( $fieldElement == 10 ) {
- $ret = <<<EOT
-\$adminmenu[\$i]['icon'] = 'assets/images/icons/32/{$tables[$t]->getVar('table_image')}';\n
-EOT;
+ break;
}
}
return $ret;
@@ -88,19 +119,8 @@
$language = $this->getLanguage($moduleDirname, 'MI', 'ADMENU');
$menu = 1;
$content = $this->getHeaderFilesComments($module, $filename);
- $content .= <<<EOT
-\$dirname = basename( dirname( dirname( __FILE__ ) ) ) ;
-\$module_handler =& xoops_gethandler('module');
-\$xoopsModule =& XoopsModule::getByDirname(\$dirname);
-\$moduleInfo =& \$module_handler->get(\$xoopsModule->getVar('mid'));
-\$sysPathIcon32 = \$moduleInfo->getInfo('sysicons32');
-\$adminmenu = array();
-\$i = 1;
-\$adminmenu[\$i]['title'] = {$language}{$menu};
-\$adminmenu[\$i]['link'] = 'admin/index.php';
-\$adminmenu[\$i]['icon'] = \$sysPathIcon32.'/dashboard.png';
-\$i++;\n
-EOT;
+ $content .= $this->getAdminMenuHeader();
+ $content .= $this->getAdminMenuDashboard($language, $menu);
foreach (array_keys($tables) as $t)
{
$tablePermissions = $tables[$t]->getVar('table_permissions');
@@ -109,9 +129,10 @@
$menu++;
$content .= <<<EOT
\$adminmenu[\$i]['title'] = {$language}{$menu};
-\$adminmenu[\$i]['link'] = 'admin/{$tables[$t]->getVar('table_name')}.php';\n
+\$adminmenu[\$i]['link'] = 'admin/{$tables[$t]->getVar('table_name')}.php';
+\$adminmenu[\$i]['icon'] = \$sysPathIcon32.'/{$tables[$t]->getVar('table_image')}';\n
EOT;
- $content .= $this->getAdminMenuPath($tables, $t);
+ //$content .= $this->getAdminMenuImagesPath($tables, $t);
$content .= <<<EOT
\$i++;\n
EOT;
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-04 09:29:45 UTC (rev 12674)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/pages.php 2014-07-05 08:07:11 UTC (rev 12675)
@@ -167,10 +167,10 @@
\$adminMenu->addItemButton({$language}{$stu_table_name}_LIST, '{$tableName}.php', 'list');
\$GLOBALS['xoopsTpl']->assign('navigation', \$adminMenu->addNavigation('{$tableName}.php'));
\$GLOBALS['xoopsTpl']->assign('buttons', \$adminMenu->renderButton());
- // Get Form
+ // Get Form
\${$tableName}Obj =& \${$tableName}Handler->create();
\$form = \${$tableName}Obj->getForm();
- \$form->display();
+ \$GLOBALS['xoopsTpl']->assign('form', \$form->render());
break;\n
EOT;
return $ret;
@@ -234,9 +234,9 @@
redirect_header('{$tableName}.php?op=list', 2, {$language}FORMOK);
}
// Get Form
- echo \${$tableName}Obj->getHtmlErrors();
+ \$GLOBALS['xoopsTpl']->assign('error', \${$tableName}Obj->getHtmlErrors());
\$form =& \${$tableName}Obj->getForm();
- \$form->display();
+ \$GLOBALS['xoopsTpl']->assign('form', \$form->render());
break;\n
EOT;
return $ret;
@@ -263,7 +263,7 @@
// Get Form
\${$tableName}Obj = \${$tableName}Handler->get(\$_REQUEST['{$fpif}']);
\$form = \${$tableName}Obj->getForm();
- \$form->display();
+ \$GLOBALS['xoopsTpl']->assign('form', \$form->render());
break;\n
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-04 09:29:45 UTC (rev 12674)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/classes/formelements.php 2014-07-05 08:07:11 UTC (rev 12675)
@@ -136,7 +136,7 @@
private function getXoopsFormUploadFile($language, $moduleDirname, $fieldName, $required = 'false') {
$ret = <<<EOT
// Form file
- \$form->addElement( new XoopsFormFile({$language}, '{$fieldName}', \$this->{$moduleDirname}->getConfig('maxsize')){$required} );\n
+ \$form->addElement( new XoopsFormFile({$language}FORM_UPLOAD_FILE, '{$fieldName}', \$this->{$moduleDirname}->getConfig('maxsize')){$required} );\n
EOT;
return $ret;
}
@@ -171,7 +171,7 @@
\$imgtray1->addElement( new XoopsFormLabel( '', "<br /><img src='".XOOPS_URL."/".\$iconsdirectory."/".\${$fieldName}."' name='image1' id='image1' alt='' />" ) );
// Form File
\$fileseltray = new XoopsFormElementTray('','<br />');
- \$fileseltray->addElement(new XoopsFormFile({$language}FORMUPLOADIMAGELIST , 'attachedfile', \$this->{$moduleDirname}->getConfig('maxsize')));
+ \$fileseltray->addElement(new XoopsFormFile({$language}FORM_UPLOAD_IMAGE_LIST , 'attachedfile', \$this->{$moduleDirname}->getConfig('maxsize')));
\$fileseltray->addElement(new XoopsFormLabel(''));
\$imgtray1->addElement(\$fileseltray);
\$form->addElement( \$imgtray1{$required} );\n
@@ -187,11 +187,8 @@
private function getXoopsFormUploadImage($language, $moduleDirname, $required = 'false') {
$ret = <<<EOT
// Form Upload Image
- \$fileseltray1 = new XoopsFormElementTray('','<br />');
- \$fileseltray1->addElement(new XoopsFormFile({$language}FORMUPLOADIMAGE , 'attachedfile', \$this->{$moduleDirname}->getConfig('maxsize')));
- \$fileseltray1->addElement(new XoopsFormLabel(''));
- \$imgtray1->addElement(\$fileseltray1);
- \$form->addElement( \$imgtray1{$required} );\n
+ \$formImage = new XoopsFormFile({$language}FORM_UPLOAD_IMAGE , 'attachedfile', \$this->{$moduleDirname}->getConfig('maxsize'));
+ \$form->addElement( \$formImage{$required} );\n
EOT;
return $ret;
}
@@ -383,7 +380,7 @@
$ret .= $this->getXoopsFormImageList($language_funct, $moduleDirname, $tableName, $fieldName, $required);
break;
case 10:
- $ret .= $this->getXoopsFormUploadImage($language, $moduleDirname, $tableName, $fieldName, $required);
+ $ret .= $this->getXoopsFormUploadImage($language_funct, $moduleDirname, $required);
break;
case 11:
$ret .= $this->getXoopsFormUploadFile($language, $moduleDirname, $fieldName, $required);
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-04 09:29:45 UTC (rev 12674)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language/admin.php 2014-07-05 08:07:11 UTC (rev 12675)
@@ -156,12 +156,31 @@
$fields = $this->getTableFields($tableId);
foreach(array_keys($fields) as $f)
{
- $field_name = $fields[$f]->getVar('field_name');
- $stu_field_name = strtoupper($field_name);
- $field_name_desc = ucfirst(str_replace('_', ' ', $field_name));
+ $fieldName = $fields[$f]->getVar('field_name');
+ $fieldElement = $fields[$f]->getVar('field_element');
+ $stu_field_name = strtoupper($fieldName);
+ $fieldNameDesc = ucfirst(str_replace('_', ' ', $fieldName));
$ret .= <<<EOT
-define('{$language}{$stu_field_name}', "{$field_name_desc}");\n
+define('{$language}{$stu_field_name}', "{$fieldNameDesc}");\n
EOT;
+ switch($fieldElement)
+ {
+ case 9:
+ $ret .= <<<EOT
+define('{$language}FORM_UPLOAD_IMAGE_LIST', "{$fieldNameDesc} in list");\n
+EOT;
+ break;
+ case 10:
+ $ret .= <<<EOT
+define('{$language}FORM_UPLOAD_IMAGE', "{$fieldNameDesc} in upload");\n
+EOT;
+ break;
+ case 11:
+ $ret .= <<<EOT
+define('{$language}FORM_UPLOAD_FILE', "{$fieldNameDesc} in upload");\n
+EOT;
+ break;
+ }
}
}
$ret .= <<<EOT
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-04 09:29:45 UTC (rev 12674)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/admin/pages.php 2014-07-05 08:07:11 UTC (rev 12675)
@@ -241,7 +241,8 @@
<strong><{\$error}></strong>
</div>
<{/if}>
-<{else}>
+<{/if}>
+<{if \$form}>
<!-- Display form (add,edit) -->
<div class="spacer"><{\$form}></div>
<{/if}>
|
|
From: <txm...@us...> - 2014-07-04 09:29:48
|
Revision: 12674
http://sourceforge.net/p/xoops/svn/12674
Author: txmodxoops
Date: 2014-07-04 09:29:45 +0000 (Fri, 04 Jul 2014)
Log Message:
-----------
- Fixed many issues for templates & admin/menu
Modified Paths:
--------------
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/templates/admin/pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/xoopsversion.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-04 08:02:45 UTC (rev 12673)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/menu.php 2014-07-04 09:29:45 UTC (rev 12674)
@@ -45,6 +45,7 @@
/*
* @public function write
* @param string $module
+ * @param mixed $table
* @param mixed $tables
* @param string $filename
*/
@@ -54,6 +55,28 @@
$this->setFileName($filename);
}
/*
+ * @private function getAdminMenuPath
+ * @param array $tables
+ * @param integer $t
+ */
+ private function getAdminMenuPath($tables, $t) {
+ $fields = $this->getTableFields($tables[$t]->getVar('table_id'));
+ foreach (array_keys($fields) as $f)
+ {
+ $fieldElement = $fields[$f]->getVar('field_element');
+ if( ($fieldElement == 9) || ( $fieldElement != 10 ) ) {
+ $ret = <<<EOT
+\$adminmenu[\$i]['icon'] = \$sysPathIcon32.'/{$tables[$t]->getVar('table_image')}';\n
+EOT;
+ } elseif( $fieldElement == 10 ) {
+ $ret = <<<EOT
+\$adminmenu[\$i]['icon'] = 'assets/images/icons/32/{$tables[$t]->getVar('table_image')}';\n
+EOT;
+ }
+ }
+ return $ret;
+ }
+ /*
* @public function render
* @param null
*/
@@ -83,29 +106,15 @@
$tablePermissions = $tables[$t]->getVar('table_permissions');
if ( $tables[$t]->getVar('table_admin') == 1 )
{
- $menu++;
+ $menu++;
$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')}';
-// Local path
+\$adminmenu[\$i]['link'] = 'admin/{$tables[$t]->getVar('table_name')}.php';\n
EOT;
- $fields = $this->getTableFields($tables[$t]->getVar('table_id'));
- foreach (array_keys($fields) as $f)
- {
- $fieldElement = $fields[$f]->getVar('field_element');
- if( $fieldElement == 9 ) {
- $content .= <<<EOT
-//\$adminmenu[\$i]['icon'] = \$sysPathIcon32.'/{$tables[$t]->getVar('table_image')}';
+ $content .= $this->getAdminMenuPath($tables, $t);
+ $content .= <<<EOT
\$i++;\n
EOT;
- } elseif( $fieldElement == 10 ) {
- $content .= <<<EOT
-//\$adminmenu[\$i]['icon'] = 'assets/images/icons/32/{$tables[$t]->getVar('table_image')}';
-\$i++;\n
-EOT;
- }
- }
}
}
if( $tablePermissions == 1 ) {
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-04 08:02:45 UTC (rev 12673)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/pages.php 2014-07-04 09:29:45 UTC (rev 12674)
@@ -64,10 +64,10 @@
public function getAdminPagesHeader($moduleDirname, $tableName) {
$ret = <<<EOT
-\ninclude_once 'header.php';
+include_once 'header.php';
//It recovered the value of argument op in URL$
\$op = {$moduleDirname}_CleanVars(\$_REQUEST, 'op', 'list', 'string');
-//
+// Switch options
switch (\$op)
{\n
EOT;
@@ -93,9 +93,9 @@
default:
\$limit = \${$moduleDirname}->getConfig('adminpager');
\$start = {$moduleDirname}_CleanVars(\$_REQUEST, 'start', 0);
- \$adminMenu->addItemButton({$language}ADD_{$stu_table_fieldname}, '{$tableName}.php?op=new', 'add');
\$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');
\$GLOBALS['xoopsTpl']->assign('buttons', \$adminMenu->renderButton());
\$criteria = new CriteriaCompo();
\$criteria->setSort('{$fpif} ASC, {$fpmf}');
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-04 08:02:45 UTC (rev 12673)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/admin/pages.php 2014-07-04 09:29:45 UTC (rev 12674)
@@ -70,8 +70,8 @@
foreach(array_keys($fields) as $f)
{
$fieldName = $fields[$f]->getVar('field_name');
- $lang_fn = $language.strtoupper($fieldName);
- if($fields[$f]->getVar('field_inlist') == 1) {
+ $lang_fn = $language.strtoupper($fieldName);
+ if( ($fields[$f]->getVar('field_inlist') == 1) || ($table->getVar('table_autoincrement') == 1) ) {
$ret .= <<<EOT
<th class="center"><{\$smarty.const.{$lang_fn}}></th>\n
EOT;
@@ -121,7 +121,7 @@
}
}
$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 8:
$ret .= <<<EOT
@@ -184,7 +184,7 @@
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 8:
$ret .= <<<EOT
@@ -241,8 +241,7 @@
<strong><{\$error}></strong>
</div>
<{/if}>
-<{/if}>
-<{if \$form}>
+<{else}>
<!-- Display form (add,edit) -->
<div class="spacer"><{\$form}></div>
<{/if}>
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-04 08:02:45 UTC (rev 12673)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/xoopsversion.php 2014-07-04 09:29:45 UTC (rev 12674)
@@ -98,7 +98,7 @@
defined('XOOPS_ROOT_PATH') or die('Restricted access');
//
\$dirname = basename( dirname( __FILE__ ) ) ;
-//
+// ---------------------- Informations ---------------------- //
\$modversion = array(
'name' => {$language}NAME,
'version' => {$module->getVar('mod_version')},
@@ -193,7 +193,7 @@
$ret = '';
if ( !empty($tableName) ) {
$ret .= <<<EOT
-\n// Mysql file
+// ---------------------- Mysql ---------------------- //
\$modversion['sqlfile']['mysql'] = "sql/mysql.sql";
// Tables\n
EOT;
@@ -216,7 +216,7 @@
private function getXoopsVersionSearch($moduleDirname)
{
$ret = <<<EOT
-// Search
+// ---------------------- Search ---------------------- //
\$modversion['hasSearch'] = 1;
\$modversion['search']['file'] = "include/search.inc.php";
\$modversion['search']['func'] = "{$moduleDirname}_search";\n
@@ -230,7 +230,7 @@
private function getXoopsVersionComments($moduleDirname)
{
$ret = <<<EOT
-// Comments
+// ---------------------- Comments ---------------------- //
\$modversion['comments']['pageName'] = "comments.php";
\$modversion['comments']['itemName'] = "com_id";
// Comment callback functions
@@ -248,7 +248,8 @@
{
$tables = $this->getTables();
$ret = <<<EOT
-// Templates Admin
+// ---------------------- Templates ---------------------- //
+// Admin
\$modversion['templates'][] = array('file' => '{$moduleDirname}_admin_about.tpl', 'description' => '', 'type' => 'admin');
\$modversion['templates'][] = array('file' => '{$moduleDirname}_admin_header.tpl', 'description' => '', 'type' => 'admin');
\$modversion['templates'][] = array('file' => '{$moduleDirname}_admin_index.tpl', 'description' => '', 'type' => 'admin');\n
@@ -278,7 +279,7 @@
{
$tables = $this->getTables();
$ret = <<<EOT
-// Templates User
+// User
\$modversion['templates'][] = array('file' => '{$moduleDirname}_header.tpl', 'description' => '');
\$modversion['templates'][] = array('file' => '{$moduleDirname}_index.tpl', 'description' => '');\n
EOT;
@@ -300,7 +301,7 @@
private function getXoopsVersionSubmenu($language)
{
$ret = <<<EOT
-// Submenu list\n
+// ---------------------- Submenu ---------------------- //\n
EOT;
$tables = $this->getTables();
$i = 1;
@@ -328,7 +329,7 @@
{
$tables = $this->getTables();
$ret = <<<EOT
-//Blocks\n
+// ---------------------- Blocks ---------------------- //\n
EOT;
foreach (array_keys($tables) as $i) {
$tableName = $tables[$i]->getVar('table_name');
@@ -357,7 +358,7 @@
{
$moduleDirname = $module->getVar('mod_dirname');
$ret = <<<EOT
-// ------------------- Config -------------------\n
+// ------------------- Config ------------------- //\n
EOT;
$fields = $this->getTableFields($table->getVar('table_id'));
foreach (array_keys($fields) as $f)
@@ -522,7 +523,7 @@
}
}
$ret .= <<<EOT
-\n// Notifications {$moduleDirname}
+// ------------------- Notifications ------------------- //
\$modversion['hasNotification'] = 1;
\$modversion['notification']['lookup_file'] = 'include/notification.inc.php';
\$modversion['notification']['lookup_func'] = '{$moduleDirname}_notify_iteminfo';
|
|
From: <txm...@us...> - 2014-07-04 08:02:50
|
Revision: 12673
http://sourceforge.net/p/xoops/svn/12673
Author: txmodxoops
Date: 2014-07-04 08:02:45 +0000 (Fri, 04 Jul 2014)
Log Message:
-----------
- Fixed several bugs
- Still work to do
Modified Paths:
--------------
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/classes/formelements.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/admin/pages.php
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-03 22:42:40 UTC (rev 12672)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/header.php 2014-07-04 08:02:45 UTC (rev 12673)
@@ -63,7 +63,7 @@
$tables = $this->getTables();
$filename = $this->getFileName();
$moduleDirname = $module->getVar('mod_dirname');
- $ucfmod_name = ucfirst($moduleDirname);
+ $ucfModuleName = ucfirst($moduleDirname);
$language = $this->getLanguage('AM');
$content = $this->getHeaderFilesComments($module, $filename);
$content .= <<<EOT
@@ -76,7 +76,7 @@
if ( $table->getVar('table_name') != '' ) {
$content .= <<<EOT
// Get instance of module
-\${$moduleDirname} = {$ucfmod_name}Helper::getInstance();\n
+\${$moduleDirname} = {$ucfModuleName}Helper::getInstance();\n
EOT;
}
$content .= <<<EOT
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-03 22:42:40 UTC (rev 12672)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/index.php 2014-07-04 08:02:45 UTC (rev 12673)
@@ -65,13 +65,13 @@
$language_thereare = $this->getLanguage($moduleDirname, 'AM', 'THEREARE_');
$content = $this->getHeaderFilesComments($module, $filename);
$content .= <<<EOT
-include_once 'header.php';\n
+include_once 'header.php';
+// Count elements\n
EOT;
foreach (array_keys($tables) as $i)
{
$tableName = $tables[$i]->getVar('table_name');
$content .= <<<EOT
-//count "{$tableName}"
\$count_{$tableName} = \${$tableName}Handler->getCount();\n
EOT;
}
@@ -80,14 +80,14 @@
\$template_main = '{$moduleDirname}_admin_index.tpl';
// InfoBox Statistics
\$adminMenu->addInfoBox({$language}STATISTICS);
-// InfoBox\n
+// Info elements\n
EOT;
foreach (array_keys($tables) as $i)
{
$tableName = $tables[$i]->getVar('table_name');
- $ta_stutable_name = $language_thereare.strtoupper($tableName);
+ $stuTableName = $language_thereare.strtoupper($tableName);
$content .= <<<EOT
-\$adminMenu->addInfoBoxLine({$language}STATISTICS, '<label>'.{$ta_stutable_name}.'</label>', \$count_{$tableName});\n
+\$adminMenu->addInfoBoxLine({$language}STATISTICS, '<label>'.{$stuTableName}.'</label>', \$count_{$tableName});\n
EOT;
}
$content .= <<<EOT
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-03 22:42:40 UTC (rev 12672)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/menu.php 2014-07-04 08:02:45 UTC (rev 12673)
@@ -26,7 +26,8 @@
* @public function constructor
* @param null
*/
- public function __construct() {
+ public function __construct() {
+ parent::__construct();
$this->tdmcfile = TDMCreateFile::getInstance();
}
/*
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-03 22:42:40 UTC (rev 12672)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/classes/formelements.php 2014-07-04 08:02:45 UTC (rev 12673)
@@ -398,7 +398,7 @@
}
break;
}
- if ($field_element > 12) {
+ if ($fieldElement > 12) {
if($table->getVar('table_category') == 1) {
$ret .= $this->getXoopsFormTopic($language, $moduleDirname, $table, $fields, $required);
} else {
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-03 22:42:40 UTC (rev 12672)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/admin/pages.php 2014-07-04 08:02:45 UTC (rev 12673)
@@ -71,9 +71,11 @@
{
$fieldName = $fields[$f]->getVar('field_name');
$lang_fn = $language.strtoupper($fieldName);
- $ret .= <<<EOT
+ if($fields[$f]->getVar('field_inlist') == 1) {
+ $ret .= <<<EOT
<th class="center"><{\$smarty.const.{$lang_fn}}></th>\n
EOT;
+ }
}
$ret .= <<<EOT
<th class="center"><{\$smarty.const.{$language}FORMACTION}></th>
@@ -119,27 +121,29 @@
}
}
$lp_field_name = substr($fieldName, 0, strpos($fieldName, '_'));
- switch( $fieldElement ) {
- case 8:
- $ret .= <<<EOT
+ if($fields[$f]->getVar('field_inlist') == 1) {
+ switch( $fieldElement ) {
+ case 8:
+ $ret .= <<<EOT
<td class="center"><span style="background-color: <{\$list.{$rp_field_name}}>;"> </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
@@ -176,31 +180,44 @@
foreach(array_keys($fields) as $f)
{
$fieldName = $fields[$f]->getVar('field_name');
- $fieldElement = $fields[$f]->getVar('field_element');
- switch( $fieldElement ) {
- case 8:
- $ret .= <<<EOT
+ $fieldElement = $fields[$f]->getVar('field_element');
+ if($f == 0) {
+ $field_id = $fieldName;
+ }
+ if($fields[$f]->getVar('field_inlist') == 1) {
+ switch( $fieldElement ) {
+ case 8:
+ $ret .= <<<EOT
<td class="center"><span style="background-color: <{\$list.{$fieldName}}>;">\t\t</span></td>\n
EOT;
- break;
- case 9:
- $ret .= <<<EOT
+ break;
+ case 9:
+ $ret .= <<<EOT
<td class="center"><img src="<{xoModuleIcons32}><{\$list.{$fieldName}}>" 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.{$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
+ <td class="center">
+ <a href="{$tableName}.php?op=edit&{$field_id}=<{\$list.{$field_id}}>" title="<{\$smarty.const._EDIT}>">
+ <img src="<{xoModuleIcons16 edit.png}>" alt="<{\$smarty.const._EDIT}>" />
+ </a>
+ <a href="{$tableName}.php?op=delete&{$field_id}=<{\$list.{$field_id}}>" title="<{\$smarty.const._DELETE}>">
+ <img src="<{xoModuleIcons16 delete.png}>" alt="<{\$smarty.const._DELETE}>" />
+ </a>
+ </td>
</tr>
<{/foreach}>
</tbody>
|
|
From: <txm...@us...> - 2014-07-03 22:42:58
|
Revision: 12672
http://sourceforge.net/p/xoops/svn/12672
Author: txmodxoops
Date: 2014-07-03 22:42:40 +0000 (Thu, 03 Jul 2014)
Log Message:
-----------
- Fixed bugs
- Updated
- Solved issue for directory images
- Added field element ImageList
- Refactoring variables to PSR system
- Still work to do
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.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/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/include/comment_functions.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/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/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
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/admin.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/sql/mysql.sql
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_fields.tpl
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php 2014-07-02 19:27:17 UTC (rev 12671)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php 2014-07-03 22:42:40 UTC (rev 12672)
@@ -80,11 +80,12 @@
$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['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['search'] = $tables_arr[$tid]->getVar('table_search');
// Get the list of fields
$criteria = new CriteriaCompo();
$criteria->add(new Criteria('field_tid', $tid));
@@ -97,9 +98,9 @@
$fields = array();
$lid = 1;
if ( $nb_fields > 0 )
- {
+ {
foreach (array_keys($fields_arr) as $fid)
- {
+ {
$field['id'] = $fid;
$field['lid'] = $lid;
$field['name'] = str_replace('_', ' ', ucfirst($fields_arr[$fid]->getVar('field_name')));
@@ -114,7 +115,7 @@
$field['required'] = $fields_arr[$fid]->getVar('field_required');
$fields[] = $field;
unset($field);
- $lid++;
+ $lid++;
}
}
unset($lid);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php 2014-07-02 19:27:17 UTC (rev 12671)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php 2014-07-03 22:42:40 UTC (rev 12672)
@@ -188,7 +188,8 @@
} else {
$tablesObj->setVar('table_image', $_POST['table_image']);
}
- $tablesObj->setVars(array('table_blocks' => (($_REQUEST['table_blocks'] == 1) ? '1' : '0'),
+ $tablesObj->setVars(array('table_autoincrement' => (($_REQUEST['table_autoincrement'] == 1) ? '1' : '0'),
+ 'table_blocks' => (($_REQUEST['table_blocks'] == 1) ? '1' : '0'),
'table_admin' => (($_REQUEST['table_admin'] == 1) ? '1' : '0'),
'table_user' => (($_REQUEST['table_user'] == 1) ? '1' : '0'),
'table_submenu' => (($_REQUEST['table_submenu'] == 1) ? '1' : '0'),
Modified: 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-07-02 19:27:17 UTC (rev 12671)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/about.php 2014-07-03 22:42:40 UTC (rev 12672)
@@ -57,17 +57,17 @@
public function render() {
$module = $this->getModule();
$filename = $this->getFileName();
- $module_dirname = $module->getVar('mod_dirname');
- $module_donations = $module->getVar('mod_donations');
+ $moduleDirname = $module->getVar('mod_dirname');
+ $moduleDonations = $module->getVar('mod_donations');
$content = $this->getHeaderFilesComments($module, $filename);
$content .= <<<EOT
include 'header.php';
-\$template_main = '{$module_dirname}_admin_about.tpl';
+\$template_main = '{$moduleDirname}_admin_about.tpl';
\$GLOBALS['xoopsTpl']->assign('navigation', \$adminMenu->addNavigation('about.php'));
-\$GLOBALS['xoopsTpl']->assign('about', \$adminMenu->renderAbout('{$module_donations}', false));
+\$GLOBALS['xoopsTpl']->assign('about', \$adminMenu->renderAbout('{$moduleDonations}', false));
include 'footer.php';
EOT;
- $this->tdmcfile->create($module_dirname, 'admin', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ $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
Modified: 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-07-02 19:27:17 UTC (rev 12671)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/footer.php 2014-07-03 22:42:40 UTC (rev 12672)
@@ -58,7 +58,7 @@
public function render() {
$module = $this->getModule();
$filename = $this->getFileName();
- $module_dirname = $module->getVar('mod_dirname');
+ $moduleDirname = $module->getVar('mod_dirname');
$content = $this->getHeaderFilesComments($module, $filename);
$content .= <<<EOT
if ( isset(\$template_main) ) {
@@ -67,7 +67,7 @@
xoops_cp_footer();
?>
EOT;
- $this->tdmcfile->create($module_dirname, 'admin', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ $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
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-02 19:27:17 UTC (rev 12671)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/header.php 2014-07-03 22:42:40 UTC (rev 12672)
@@ -62,8 +62,8 @@
$table = $this->getTable();
$tables = $this->getTables();
$filename = $this->getFileName();
- $module_dirname = $module->getVar('mod_dirname');
- $ucfmod_name = ucfirst($module_dirname);
+ $moduleDirname = $module->getVar('mod_dirname');
+ $ucfmod_name = ucfirst($moduleDirname);
$language = $this->getLanguage('AM');
$content = $this->getHeaderFilesComments($module, $filename);
$content .= <<<EOT
@@ -76,7 +76,7 @@
if ( $table->getVar('table_name') != '' ) {
$content .= <<<EOT
// Get instance of module
-\${$module_dirname} = {$ucfmod_name}Helper::getInstance();\n
+\${$moduleDirname} = {$ucfmod_name}Helper::getInstance();\n
EOT;
}
$content .= <<<EOT
@@ -91,9 +91,9 @@
EOT;
foreach (array_keys($tables) as $i)
{
- $table_name = $tables[$i]->getVar('table_name');
+ $tableName = $tables[$i]->getVar('table_name');
$content .= <<<EOT
-\${$table_name}Handler =& \${$module_dirname}->getHandler('{$table_name}');\n
+\${$tableName}Handler =& \${$moduleDirname}->getHandler('{$tableName}');\n
EOT;
}
$content .=<<<EOT
@@ -122,7 +122,7 @@
xoops_cp_header();
\$adminMenu = new ModuleAdmin();
EOT;
- $this->tdmcfile->create($module_dirname, 'admin', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ $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
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-02 19:27:17 UTC (rev 12671)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/index.php 2014-07-03 22:42:40 UTC (rev 12672)
@@ -60,34 +60,34 @@
$module = $this->getModule();
$tables = $this->getTables();
$filename = $this->getFileName();
- $module_dirname = $module->getVar('mod_dirname');
- $language = $this->getLanguage($module_dirname, 'AM');
- $language_thereare = $this->getLanguage($module_dirname, 'AM', 'THEREARE_');
+ $moduleDirname = $module->getVar('mod_dirname');
+ $language = $this->getLanguage($moduleDirname, 'AM');
+ $language_thereare = $this->getLanguage($moduleDirname, 'AM', 'THEREARE_');
$content = $this->getHeaderFilesComments($module, $filename);
$content .= <<<EOT
include_once 'header.php';\n
EOT;
foreach (array_keys($tables) as $i)
{
- $table_name = $tables[$i]->getVar('table_name');
+ $tableName = $tables[$i]->getVar('table_name');
$content .= <<<EOT
-//count "{$table_name}"
-\$count_{$table_name} = \${$table_name}Handler->getCount();\n
+//count "{$tableName}"
+\$count_{$tableName} = \${$tableName}Handler->getCount();\n
EOT;
}
$content .= <<<EOT
// Template Index
-\$template_main = '{$module_dirname}_admin_index.tpl';
+\$template_main = '{$moduleDirname}_admin_index.tpl';
// InfoBox Statistics
\$adminMenu->addInfoBox({$language}STATISTICS);
// InfoBox\n
EOT;
foreach (array_keys($tables) as $i)
{
- $table_name = $tables[$i]->getVar('table_name');
- $ta_stutable_name = $language_thereare.strtoupper($table_name);
+ $tableName = $tables[$i]->getVar('table_name');
+ $ta_stutable_name = $language_thereare.strtoupper($tableName);
$content .= <<<EOT
-\$adminMenu->addInfoBoxLine({$language}STATISTICS, '<label>'.{$ta_stutable_name}.'</label>', \$count_{$table_name});\n
+\$adminMenu->addInfoBoxLine({$language}STATISTICS, '<label>'.{$ta_stutable_name}.'</label>', \$count_{$tableName});\n
EOT;
}
$content .= <<<EOT
@@ -96,7 +96,7 @@
echo \$adminMenu->renderIndex();
include_once 'footer.php';
EOT;
- $this->tdmcfile->create($module_dirname, 'admin', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ $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
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-02 19:27:17 UTC (rev 12671)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/menu.php 2014-07-03 22:42:40 UTC (rev 12672)
@@ -60,8 +60,8 @@
$module = $this->getModule();
$tables = $this->getTables();
$filename = $this->getFileName();
- $module_dirname = $module->getVar('mod_dirname');
- $language = $this->getLanguage($module_dirname, 'MI', 'ADMENU');
+ $moduleDirname = $module->getVar('mod_dirname');
+ $language = $this->getLanguage($moduleDirname, 'MI', 'ADMENU');
$menu = 1;
$content = $this->getHeaderFilesComments($module, $filename);
$content .= <<<EOT
@@ -77,23 +77,37 @@
\$adminmenu[\$i]['icon'] = \$sysPathIcon32.'/dashboard.png';
\$i++;\n
EOT;
- foreach (array_keys($tables) as $i)
+ foreach (array_keys($tables) as $t)
{
- $table_permissions = $tables[$i]->getVar('table_permissions');
- if ( $tables[$i]->getVar('table_admin') == 1 )
+ $tablePermissions = $tables[$t]->getVar('table_permissions');
+ if ( $tables[$t]->getVar('table_admin') == 1 )
{
- $menu++;
+ $menu++;
$content .= <<<EOT
\$adminmenu[\$i]['title'] = {$language}{$menu};
-\$adminmenu[\$i]['link'] = 'admin/{$tables[$i]->getVar('table_name')}.php';
-\$adminmenu[\$i]['icon'] = \$sysPathIcon32.'/{$tables[$i]->getVar('table_image')}';
+\$adminmenu[\$i]['link'] = 'admin/{$tables[$t]->getVar('table_name')}.php';
+\$adminmenu[\$i]['icon'] = \$sysPathIcon32.'/{$tables[$t]->getVar('table_image')}';
// Local path
-//\$adminmenu[\$i]['icon'] = 'assets/images/icons/32/{$tables[$i]->getVar('table_image')}';
+EOT;
+ $fields = $this->getTableFields($tables[$t]->getVar('table_id'));
+ foreach (array_keys($fields) as $f)
+ {
+ $fieldElement = $fields[$f]->getVar('field_element');
+ if( $fieldElement == 9 ) {
+ $content .= <<<EOT
+//\$adminmenu[\$i]['icon'] = \$sysPathIcon32.'/{$tables[$t]->getVar('table_image')}';
\$i++;\n
EOT;
+ } elseif( $fieldElement == 10 ) {
+ $content .= <<<EOT
+//\$adminmenu[\$i]['icon'] = 'assets/images/icons/32/{$tables[$t]->getVar('table_image')}';
+\$i++;\n
+EOT;
+ }
+ }
}
}
- if( $table_permissions == 1 ) {
+ if( $tablePermissions == 1 ) {
$menu++;
$content .= <<<EOT
\$adminmenu[\$i]['title'] = {$language}{$menu};
@@ -111,7 +125,7 @@
EOT;
unset( $menu );
- $this->tdmcfile->create($module_dirname, 'admin', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ $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
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-02 19:27:17 UTC (rev 12671)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/objects.php 2014-07-03 22:42:40 UTC (rev 12672)
@@ -36,86 +36,116 @@
}
/*
* @public function getSimpleSetVar
- * @param string $table_name
- * @param string $field_name
+ * @param string $tableName
+ * @param string $fieldName
*/
- public function getSimpleSetVar($table_name, $field_name) {
+ public function getSimpleSetVar($tableName, $fieldName) {
$ret = <<<EOT
- \${$table_name}Obj->setVar('{$field_name}', \$_POST['{$field_name}']);\n
+ \${$tableName}Obj->setVar('{$fieldName}', \$_POST['{$fieldName}']);\n
EOT;
return $ret;
}
/*
* @public function getTextDateSelect
- * @param string $table_name
- * @param string $field_name
+ * @param string $tableName
+ * @param string $fieldName
*/
- public function getTextDateSelect($table_name, $field_name) {
+ public function getTextDateSelect($tableName, $fieldName) {
$ret = <<<EOT
- \${$table_name}Obj->setVar('{$field_name}', strtotime(\$_POST['{$field_name}']));\n
+ \${$tableName}Obj->setVar('{$fieldName}', strtotime(\$_POST['{$fieldName}']));\n
EOT;
return $ret;
}
/*
* @public function getCheckBoxOrRadioYN
- * @param string $table_name
- * @param string $field_name
+ * @param string $tableName
+ * @param string $fieldName
*/
- public function getCheckBoxOrRadioYN($table_name, $field_name) {
+ public function getCheckBoxOrRadioYN($tableName, $fieldName) {
$ret = <<<EOT
- \${$table_name}Obj->setVar('{$field_name}', ((\$_REQUEST['{$field_name}'] == 1) ? '1' : '0'));\n
+ \${$tableName}Obj->setVar('{$fieldName}', ((\$_REQUEST['{$fieldName}'] == 1) ? '1' : '0'));\n
EOT;
return $ret;
}
/*
+ * @public function getImageList
+ * @param string $moduleDirname
+ * @param string $tableName
+ * @param string $fieldName
+ */
+ public function getImageList($moduleDirname, $tableName, $fieldName) {
+ $ret = <<<EOT
+ // Set Var Image
+ include_once XOOPS_ROOT_PATH.'/class/uploader.php';
+ \$uploaddir = XOOPS_ROOT_PATH . '/Frameworks/moduleclasses/icons/32';
+ \$uploader = new XoopsMediaUploader(\$uploaddir, \${$moduleDirname}->getConfig('mimetypes'),
+ \${$moduleDirname}->getConfig('maxsize'), null, null);
+ if (\$uploader->fetchMedia(\$_POST['xoops_upload_file'][0])) {
+ //\$uploader->setPrefix('{$fieldName}_');
+ //\$uploader->fetchMedia(\$_POST['xoops_upload_file'][0]);
+ if (!\$uploader->upload()) {
+ \$errors = \$uploader->getErrors();
+ redirect_header('javascript:history.go(-1)', 3, \$errors);
+ } else {
+ \${$tableName}Obj->setVar('{$fieldName}', \$uploader->getSavedFileName());
+ }
+ } else {
+ \${$tableName}Obj->setVar('{$fieldName}', \$_POST['{$fieldName}']);
+ }\n
+EOT;
+ return $ret;
+ }
+ /*
* @public function getUploadImage
- * @param string $module_dirname
- * @param string $table_name
- * @param string $field_name
+ * @param string $moduleDirname
+ * @param string $tableName
+ * @param string $fieldName
*/
- public function getUploadImage($module_dirname, $table_name, $field_name) {
+ public function getUploadImage($moduleDirname, $tableName, $fieldName) {
+ $stuModuleDirname = strtolower($moduleDirname);
$ret = <<<EOT
// Set Var Image
include_once XOOPS_ROOT_PATH.'/class/uploader.php';
- \$uploaddir = XOOPS_UPLOAD_PATH.'/{$module_dirname}/images/{$table_name}/';
- \$uploader = new XoopsMediaUploader(\$uploaddir, \${$module_dirname}->getConfig('mimetypes'),
- \${$module_dirname}->getConfig('maxsize'), null, null);
+ \$uploaddir = {$stuModuleDirname}_UPLOAD_PATH.'/images/{$tableName}';
+ \$uploader = new XoopsMediaUploader(\$uploaddir, \${$moduleDirname}->getConfig('mimetypes'),
+ \${$moduleDirname}->getConfig('maxsize'), null, null);
if (\$uploader->fetchMedia(\$_POST['xoops_upload_file'][0])) {
- \$uploader->setPrefix('{$field_name}_');
- \$uploader->fetchMedia(\$_POST['xoops_upload_file'][0]);
+ //\$uploader->setPrefix('{$fieldName}_');
+ //\$uploader->fetchMedia(\$_POST['xoops_upload_file'][0]);
if (!\$uploader->upload()) {
\$errors = \$uploader->getErrors();
redirect_header('javascript:history.go(-1)', 3, \$errors);
} else {
- \${$table_name}Obj->setVar('{$field_name}', \$uploader->getSavedFileName());
+ \${$tableName}Obj->setVar('{$fieldName}', \$uploader->getSavedFileName());
}
} else {
- \${$table_name}Obj->setVar('{$field_name}', \$_POST['{$field_name}']);
+ \${$tableName}Obj->setVar('{$fieldName}', \$_POST['{$fieldName}']);
}\n
EOT;
return $ret;
}
/*
* @public function getUploadFile
- * @param string $module_dirname
- * @param string $table_name
- * @param string $field_name
+ * @param string $moduleDirname
+ * @param string $tableName
+ * @param string $fieldName
*/
- public function getUploadFile($module_dirname, $table_name, $field_name) {
+ public function getUploadFile($moduleDirname, $tableName, $fieldName) {
+ $stuModuleDirname = strtolower($moduleDirname);
$ret = <<<EOT
// Set Var File
include_once XOOPS_ROOT_PATH.'/class/uploader.php';
- \$uploaddir = XOOPS_UPLOAD_PATH.'/{$module_dirname}/files/{$table_name}/';
- \$uploader = new XoopsMediaUploader(\$uploaddir, \${$module_dirname}->getConfig('mimetypes'),
- \${$module_dirname}->getConfig('maxsize'), null, null);
+ \$uploaddir = {$stuModuleDirname}_UPLOAD_PATH.'/files/{$tableName}';
+ \$uploader = new XoopsMediaUploader(\$uploaddir, \${$moduleDirname}->getConfig('mimetypes'),
+ \${$moduleDirname}->getConfig('maxsize'), null, null);
if (\$uploader->fetchMedia(\$_POST['xoops_upload_file'][0])) {
- \$uploader->setPrefix('{$field_name}_') ;
- \$uploader->fetchMedia(\$_POST['xoops_upload_file'][0]);
+ //\$uploader->setPrefix('{$fieldName}_') ;
+ //\$uploader->fetchMedia(\$_POST['xoops_upload_file'][0]);
if (!\$uploader->upload()) {
\$errors = \$uploader->getErrors();
redirect_header('javascript:history.go(-1)', 3, \$errors);
} else {
- \${$table_name}Obj->setVar('{$field_name}', \$uploader->getSavedFileName());
+ \${$tableName}Obj->setVar('{$fieldName}', \$uploader->getSavedFileName());
}
}\n
EOT;
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-02 19:27:17 UTC (rev 12671)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/pages.php 2014-07-03 22:42:40 UTC (rev 12672)
@@ -58,17 +58,16 @@
}
/*
* @public function getAdminPagesHeader
- * @param string $module_dirname
- * @param string $table_name
+ * @param string $moduleDirname
+ * @param string $tableName
*/
- public function getAdminPagesHeader($module_dirname, $table_name) {
+ public function getAdminPagesHeader($moduleDirname, $tableName) {
$ret = <<<EOT
\ninclude_once 'header.php';
//It recovered the value of argument op in URL$
-\$op = {$module_dirname}_CleanVars(\$_REQUEST, 'op', 'list', 'string');
-// Navigation
-echo \$adminMenu->addNavigation('{$table_name}.php');
+\$op = {$moduleDirname}_CleanVars(\$_REQUEST, 'op', 'list', 'string');
+//
switch (\$op)
{\n
EOT;
@@ -77,72 +76,73 @@
/*
* @public function getAdminPagesList
- * @param string $module_dirname
- * @param string $table_name
- * @param string $table_fieldname
+ * @param string $moduleDirname
+ * @param string $tableName
+ * @param string $tableFieldname
* @param string $language
* @param string $fields
* @param string $fpif
* @param string $fpmf
*/
- public function getAdminPagesList($module_dirname, $table_name, $table_fieldname, $language, $fields, $fpif, $fpmf) {
- $stu_module_dirname = strtoupper($module_dirname);
- $stu_table_name = strtoupper($table_name);
- $stu_table_fieldname = strtoupper($table_fieldname);
+ 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);
$ret = <<<EOT
case 'list':
default:
- \$limit = \${$module_dirname}->getConfig('adminpager');
- \$start = {$module_dirname}_CleanVars(\$_REQUEST, 'start', 0);
- \$adminMenu->addItemButton({$language}ADD_{$stu_table_fieldname}, '{$table_name}.php?op=new', 'add');
- \$template_main = '{$module_dirname}_admin_{$table_name}.tpl';
- echo \$adminMenu->renderButton();
+ \$limit = \${$moduleDirname}->getConfig('adminpager');
+ \$start = {$moduleDirname}_CleanVars(\$_REQUEST, 'start', 0);
+ \$adminMenu->addItemButton({$language}ADD_{$stu_table_fieldname}, '{$tableName}.php?op=new', 'add');
+ \$template_main = '{$moduleDirname}_admin_{$tableName}.tpl';
+ \$GLOBALS['xoopsTpl']->assign('navigation', \$adminMenu->addNavigation('{$tableName}.php'));
+ \$GLOBALS['xoopsTpl']->assign('buttons', \$adminMenu->renderButton());
\$criteria = new CriteriaCompo();
\$criteria->setSort('{$fpif} ASC, {$fpmf}');
\$criteria->setOrder('ASC');
- \${$table_name}_rows = \${$table_name}Handler->getCount(\$criteria);
- \${$table_name}_arr = \${$table_name}Handler->getAll(\$criteria);
+ \${$tableName}_rows = \${$tableName}Handler->getCount(\$criteria);
+ \${$tableName}_arr = \${$tableName}Handler->getAll(\$criteria);
unset(\$criteria);
- \$GLOBALS['xoopsTpl']->assign('{$module_dirname}_url', {$stu_module_dirname}_URL);
- \$GLOBALS['xoopsTpl']->assign('{$module_dirname}_upload_url', {$stu_module_dirname}_UPLOAD_URL);
+ \$GLOBALS['xoopsTpl']->assign('{$moduleDirname}_url', {$stu_module_dirname}_URL);
+ \$GLOBALS['xoopsTpl']->assign('{$moduleDirname}_upload_url', {$stu_module_dirname}_UPLOAD_URL);
// Table view
- if (\${$table_name}_rows > 0)
+ if (\${$tableName}_rows > 0)
{
- foreach (array_keys(\${$table_name}_arr) as \$i)
+ foreach (array_keys(\${$tableName}_arr) as \$i)
{\n
EOT;
foreach(array_keys($fields) as $f)
{
- $field_name = $fields[$f]->getVar('field_name');
- $rp_field_name = $field_name;
+ $fieldName = $fields[$f]->getVar('field_name');
+ $rp_field_name = $fieldName;
// Verify if table_fieldname is not empty
- if(!empty($table_fieldname)) {
- if(strpos($field_name, '_')) {
- $str = strpos($field_name, '_');
+ if(!empty($tableFieldname)) {
+ if(strpos($fieldName, '_')) {
+ $str = strpos($fieldName, '_');
if($str !== false){
- $rp_field_name = substr($field_name, $str + 1, strlen($field_name));
+ $rp_field_name = substr($fieldName, $str + 1, strlen($fieldName));
}
}
- $lp_field_name = substr($field_name, 0, strpos($field_name, '_'));
+ $lp_field_name = substr($fieldName, 0, strpos($fieldName, '_'));
$ret .= <<<EOT
- \${$lp_field_name}['{$rp_field_name}'] = \${$table_name}_arr[\$i]->getVar('{$field_name}');\n
+ \${$lp_field_name}['{$rp_field_name}'] = \${$tableName}_arr[\$i]->getVar('{$fieldName}');\n
EOT;
} else {
- $lp_field_name = $table_name;
+ $lp_field_name = $tableName;
$ret .= <<<EOT
- \${$lp_field_name}['{$rp_field_name}'] = \${$table_name}_arr[\$i]->getVar('{$field_name}');\n
+ \${$lp_field_name}['{$rp_field_name}'] = \${$tableName}_arr[\$i]->getVar('{$fieldName}');\n
EOT;
}
}
$ret .= <<<EOT
- \$GLOBALS['xoopsTpl']->append('{$table_name}_list', \${$lp_field_name});
+ \$GLOBALS['xoopsTpl']->append('{$tableName}_list', \${$lp_field_name});
unset(\${$lp_field_name});
}\n
EOT;
$ret .= <<<EOT
- if ( \${$table_name}_rows > \$limit ) {
+ if ( \${$tableName}_rows > \$limit ) {
include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
- \$pagenav = new XoopsPageNav(\${$table_name}_rows, \$limit, \$start, 'start', 'op=list&limit=' . \$limit);
+ \$pagenav = new XoopsPageNav(\${$tableName}_rows, \$limit, \$start, 'start', 'op=list&limit=' . \$limit);
\$GLOBALS['xoopsTpl']->assign('pagenav', \$pagenav->renderNav(4));
}
} else {
@@ -155,20 +155,21 @@
/*
* @public function getAdminPagesNew
- * @param string $module_dirname
- * @param string $table_name
+ * @param string $moduleDirname
+ * @param string $tableName
* @param string $language
*/
- public function getAdminPagesNew($module_dirname, $table_name, $language) {
- $stu_table_name = strtoupper($table_name);
+ public function getAdminPagesNew($moduleDirname, $tableName, $language) {
+ $stu_table_name = strtoupper($tableName);
$ret = <<<EOT
case 'new':
- \$template_main = '{$module_dirname}_admin_{$table_name}.tpl';
- \$adminMenu->addItemButton({$language}{$stu_table_name}_LIST, '{$table_name}.php', 'list');
- echo \$adminMenu->renderButton();
+ \$template_main = '{$moduleDirname}_admin_{$tableName}.tpl';
+ \$adminMenu->addItemButton({$language}{$stu_table_name}_LIST, '{$tableName}.php', 'list');
+ \$GLOBALS['xoopsTpl']->assign('navigation', \$adminMenu->addNavigation('{$tableName}.php'));
+ \$GLOBALS['xoopsTpl']->assign('buttons', \$adminMenu->renderButton());
// Get Form
- \${$table_name}Obj =& \${$table_name}Handler->create();
- \$form = \${$table_name}Obj->getForm();
+ \${$tableName}Obj =& \${$tableName}Handler->create();
+ \$form = \${$tableName}Obj->getForm();
\$form->display();
break;\n
EOT;
@@ -177,48 +178,51 @@
/*
* @public function getAdminPagesSave
- * @param string $module_dirname
- * @param string $table_name
+ * @param string $moduleDirname
+ * @param string $tableName
* @param string $language
* @param string $fields
* @param string $fpif
* @param string $fpmf
*/
- public function getAdminPagesSave($module_dirname, $table_name, $language, $fields, $fpif, $fpmf)
+ public function getAdminPagesSave($moduleDirname, $tableName, $language, $fields, $fpif, $fpmf)
{
$ret = <<<EOT
case 'save':
if ( !\$GLOBALS['xoopsSecurity']->check() ) {
- redirect_header('{$table_name}.php', 3, implode(',', \$GLOBALS['xoopsSecurity']->getErrors()));
+ redirect_header('{$tableName}.php', 3, implode(',', \$GLOBALS['xoopsSecurity']->getErrors()));
}
if (isset(\$_REQUEST['{$fpif}'])) {
- \${$table_name}Obj =& \${$table_name}Handler->get(\$_REQUEST['{$fpif}']);
+ \${$tableName}Obj =& \${$tableName}Handler->get(\$_REQUEST['{$fpif}']);
} else {
- \${$table_name}Obj =& \${$table_name}Handler->create();
+ \${$tableName}Obj =& \${$tableName}Handler->create();
}
// Set Vars\n
EOT;
foreach (array_keys($fields) as $f)
{
- $field_name = $fields[$f]->getVar('field_name');
- $field_element = $fields[$f]->getVar('field_element');
+ $fieldName = $fields[$f]->getVar('field_name');
+ $fieldElement = $fields[$f]->getVar('field_element');
if($f > 0) { // If we want to hide field id
- switch($field_element) {
+ switch($fieldElement) {
case 4:
case 5:
- $ret .= $this->adminobjects->getCheckBoxOrRadioYN($table_name, $field_name);
+ $ret .= $this->adminobjects->getCheckBoxOrRadioYN($tableName, $fieldName);
break;
case 9:
- $ret .= $this->adminobjects->getUploadImage($module_dirname, $table_name, $field_name);
+ $ret .= $this->adminobjects->getImageList($moduleDirname, $tableName, $fieldName);
break;
case 10:
- $ret .= $this->adminobjects->getUploadFile($module_dirname, $table_name, $field_name);
+ $ret .= $this->adminobjects->getUploadImage($moduleDirname, $tableName, $fieldName);
break;
case 11:
- $ret .= $this->adminobjects->getTextDateSelect($table_name, $field_name);
+ $ret .= $this->adminobjects->getUploadFile($moduleDirname, $tableName, $fieldName);
break;
+ case 12:
+ $ret .= $this->adminobjects->getTextDateSelect($tableName, $fieldName);
+ break;
default:
- $ret .= $this->adminobjects->getSimpleSetVar($table_name, $field_name);
+ $ret .= $this->adminobjects->getSimpleSetVar($tableName, $fieldName);
break;
}
}
@@ -226,12 +230,12 @@
$ret .= <<<EOT
// Insert Data
- if (\${$table_name}Handler->insert(\${$table_name}Obj)) {
- redirect_header('{$table_name}.php?op=list', 2, {$language}FORMOK);
+ if (\${$tableName}Handler->insert(\${$tableName}Obj)) {
+ redirect_header('{$tableName}.php?op=list', 2, {$language}FORMOK);
}
// Get Form
- echo \${$table_name}Obj->getHtmlErrors();
- \$form =& \${$table_name}Obj->getForm();
+ echo \${$tableName}Obj->getHtmlErrors();
+ \$form =& \${$tableName}Obj->getForm();
\$form->display();
break;\n
EOT;
@@ -240,24 +244,25 @@
/*
* @public function getAdminPagesEdit
- * @param string $module_dirname
- * @param string $table_name
- * @param string $table_fieldname
+ * @param string $moduleDirname
+ * @param string $tableName
+ * @param string $tableFieldname
* @param string $language
* @param string $fpif
*/
- public function getAdminPagesEdit($module_dirname, $table_name, $table_fieldname, $language, $fpif) {
- $stu_table_name = strtoupper($table_name);
- $stu_table_fieldname = strtoupper($table_fieldname);
+ public function getAdminPagesEdit($moduleDirname, $tableName, $tableFieldname, $language, $fpif) {
+ $stu_table_name = strtoupper($tableName);
+ $stu_table_fieldname = strtoupper($tableFieldname);
$ret = <<<EOT
case 'edit':
- \$template_main = '{$module_dirname}_admin_{$table_name}.tpl';
- \$adminMenu->addItemButton({$language}ADD_{$stu_table_fieldname}, '{$table_name}.php?op=new', 'add');
- \$adminMenu->addItemButton({$language}{$stu_table_name}_LIST, '{$table_name}.php', 'list');
- echo \$adminMenu->renderButton();
+ \$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');
+ \$GLOBALS['xoopsTpl']->assign('navigation', \$adminMenu->addNavigation('{$tableName}.php'));
+ \$GLOBALS['xoopsTpl']->assign('buttons', \$adminMenu->renderButton());
// Get Form
- \${$table_name}Obj = \${$table_name}Handler->get(\$_REQUEST['{$fpif}']);
- \$form = \${$table_name}Obj->getForm();
+ \${$tableName}Obj = \${$tableName}Handler->get(\$_REQUEST['{$fpif}']);
+ \$form = \${$tableName}Obj->getForm();
\$form->display();
break;\n
EOT;
@@ -266,25 +271,25 @@
/*
* @public function getAdminPagesDelete
- * @param string $table_name
+ * @param string $tableName
* @param string $language
*/
- public function getAdminPagesDelete($table_name, $language, $fpif, $fpmf) {
+ public function getAdminPagesDelete($tableName, $language, $fpif, $fpmf) {
$ret = <<<EOT
case 'delete':
- \${$table_name}Obj =& \${$table_name}Handler->get(\$_REQUEST['{$fpif}']);
+ \${$tableName}Obj =& \${$tableName}Handler->get(\$_REQUEST['{$fpif}']);
if (isset(\$_REQUEST['ok']) && \$_REQUEST['ok'] == 1) {
if ( !\$GLOBALS['xoopsSecurity']->check() ) {
- redirect_header('{$table_name}.php', 3, implode(', ', \$GLOBALS['xoopsSecurity']->getErrors()));
+ redirect_header('{$tableName}.php', 3, implode(', ', \$GLOBALS['xoopsSecurity']->getErrors()));
}
- if (\${$table_name}Handler->delete(\${$table_name}Obj)) {
- redirect_header('{$table_name}.php', 3, {$language}FORMDELOK);
+ if (\${$tableName}Handler->delete(\${$tableName}Obj)) {
+ redirect_header('{$tableName}.php', 3, {$language}FORMDELOK);
} else {
- echo \${$table_name}Obj->getHtmlErrors();
+ echo \${$tableName}Obj->getHtmlErrors();
}
} else {
- xoops_confirm(array('ok' => 1, '{$fpif}' => \$_REQUEST['{$fpif}'], 'op' => 'delete'), \$_SERVER['REQUEST_URI'], sprintf({$language}FORMSUREDEL, \${$table_name}Obj->getVar('{$fpmf}')));
+ xoops_confirm(array('ok' => 1, '{$fpif}' => \$_REQUEST['{$fpif}'], 'op' => 'delete'), \$_SERVER['REQUEST_URI'], sprintf({$language}FORMSUREDEL, \${$tableName}Obj->getVar('{$fpmf}')));
}
break;\n
EOT;
@@ -311,31 +316,31 @@
{
$module = $this->getModule();
$table = $this->getTable();
- $module_dirname = $module->getVar('mod_dirname');
- $table_name = $table->getVar('table_name');
- $table_fieldname = $table->getVar('table_fieldname');
- $language = $this->getLanguage($module_dirname, 'AM');
+ $moduleDirname = $module->getVar('mod_dirname');
+ $tableName = $table->getVar('table_name');
+ $tableFieldname = $table->getVar('table_fieldname');
+ $language = $this->getLanguage($moduleDirname, 'AM');
$fields = $this->getTableFields($table->getVar('table_id'));
foreach(array_keys($fields) as $f)
{
- $field_name = $fields[$f]->getVar('field_name');
+ $fieldName = $fields[$f]->getVar('field_name');
if($f == 0) {
- $fpif = $field_name;
+ $fpif = $fieldName;
}
if($fields[$f]->getVar('field_main') == 1) {
- $fpmf = $field_name;
+ $fpmf = $fieldName;
}
}
$content = $this->getHeaderFilesComments($module, $filename);
- $content .= $this->getAdminPagesHeader($module_dirname, $table_name);
- $content .= $this->getAdminPagesList($module_dirname, $table_name, $table_fieldname, $language, $fields, $fpif, $fpmf);
- $content .= $this->getAdminPagesNew($module_dirname, $table_name, $language);
- $content .= $this->getAdminPagesSave($module_dirname, $table_name, $language, $fields, $fpif, $fpmf);
- $content .= $this->getAdminPagesEdit($module_dirname, $table_name, $table_fieldname, $language, $fpif);
- $content .= $this->getAdminPagesDelete($table_name, $language, $fpif, $fpmf);
+ $content .= $this->getAdminPagesHeader($moduleDirname, $tableName);
+ $content .= $this->getAdminPagesList($moduleDirname, $tableName, $tableFieldname, $language, $fields, $fpif, $fpmf);
+ $content .= $this->getAdminPagesNew($moduleDirname, $tableName, $language);
+ $content .= $this->getAdminPagesSave($moduleDirname, $tableName, $language, $fields, $fpif, $fpmf);
+ $content .= $this->getAdminPagesEdit($moduleDirname, $tableName, $tableFieldname, $language, $fpif);
+ $content .= $this->getAdminPagesDelete($tableName, $language, $fpif, $fpmf);
$content .= $this->getAdminPagesFooter();
//
- $this->tdmcfile->create($module_dirname, 'admin', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ $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
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/permissions.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/permissions.php 2014-07-02 19:27:17 UTC (rev 12671)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/permissions.php 2014-07-03 22:42:40 UTC (rev 12672)
@@ -55,10 +55,10 @@
}
/*
* @private function getPermissionsCodeHeader
- * @param string $module_dirname
+ * @param string $moduleDirname
* @param string $language
*/
- private function getPermissionsCodeHeader($module_dirname, $language)
+ private function getPermissionsCodeHeader($moduleDirname, $language)
{
$ret = <<<PRM
\ninclude_once 'header.php';
@@ -73,10 +73,10 @@
if (count ( array_intersect ( \$group, \$groups ) ) <= 0) {
redirect_header ( 'index.php', 3, _NOPERM );
}*/
-\$template_main = '{$module_dirname}_admin_permissions.tpl';
+\$template_main = '{$moduleDirname}_admin_permissions.tpl';
echo \$adminMenu->addNavigation('permissions.php');
-\$permission = {$module_dirname}_CleanVars(\$_REQUEST, 'permission', 1, 'int');
+\$permission = {$moduleDirname}_CleanVars(\$_REQUEST, 'permission', 1, 'int');
\$selected = array('', '', '', '');
\$selected[\$permission-1] = ' selected';
xoops_load('XoopsFormLoader');
@@ -95,10 +95,10 @@
/*
* @private function getPermissionsCodeSwitch
- * @param string $module_dirname
+ * @param string $moduleDirname
* @param string $language
*/
- private function getPermissionsCodeSwitch($module_dirname, $language)
+ private function getPermissionsCodeSwitch($moduleDirname, $language)
{
$ret = <<<PRM
\$module_id = \$xoopsModule->getVar('mid');
@@ -106,7 +106,7 @@
{
case 1:
\$formTitle = {$language}GLOBAL;
- \$permName = '{$module_dirname}_ac';
+ \$permName = '{$moduleDirname}_ac';
\$permDesc = {$language}GLOBAL_DESC;
\$globalPerms = array( '4' => {$language}GLOBAL_4,
'8' => {$language}GLOBAL_8,
@@ -114,17 +114,17 @@
break;
case 2:
\$formTitle = {$language}APPROVE;
- \$permName = '{$module_dirname}_access';
+ \$permName = '{$moduleDirname}_access';
\$permDesc = {$language}APPROVE_DESC;
break;
case 3:
\$formTitle = {$language}SUBMIT;
- \$permName = '{$module_dirname}_submit';
+ \$permName = '{$moduleDirname}_submit';
\$permDesc = {$language}SUBMIT_DESC;
break;
case 4:
\$formTitle = {$language}VIEW;
- \$permName = '{$module_dirname}_view';
+ \$permName = '{$moduleDirname}_view';
\$permDesc = {$language}VIEW_DESC;
break;
}\n
@@ -134,21 +134,21 @@
/*
* @private function getPermissionsCodeBody
- * @param string $module_dirname
- * @param string $table_name
+ * @param string $moduleDirname
+ * @param string $tableName
* @param string $language
*/
- private function getPermissionsCodeBody($module_dirname, $language)
+ private function getPermissionsCodeBody($moduleDirname, $language)
{
$tables = $this->getTables();
foreach(array_keys($tables) as $t)
{
- $table_id = $tables[$t]->getVar('table_id');
+ $tableId = $tables[$t]->getVar('table_id');
if($tables[$t]->getVar('table_permissions') == 1) {
- $table_name = $tables[$t]->getVar('table_name');
+ $tableName = $tables[$t]->getVar('table_name');
}
}
- $fields = $this->getTableFields($table_id);
+ $fields = $this->getTableFields($tableId);
foreach(array_keys($fields) as $f)
{
if($f == 0) {
@@ -170,18 +170,18 @@
\$criteria = new CriteriaCompo();
\$criteria->setSort('{$fpmf}');
\$criteria->setOrder('ASC');
- \${$table_name}_count = \${$table_name}Handler->getCount(\$criteria);
- \${$table_name}_arr = \${$table_name}Handler->getObjects(\$criteria);
+ \${$tableName}_count = \${$tableName}Handler->getCount(\$criteria);
+ \${$tableName}_arr = \${$tableName}Handler->getObjects(\$criteria);
unset(\$criteria);
- foreach (array_keys(\${$table_name}_arr) as \$i) {
- \$permform->addItem(\${$table_name}_arr[\$i]->getVar('{$fpif}'), \${$table_name}_arr[\$i]->getVar('{$fpmf}'));
+ foreach (array_keys(\${$tableName}_arr) as \$i) {
+ \$permform->addItem(\${$tableName}_arr[\$i]->getVar('{$fpif}'), \${$tableName}_arr[\$i]->getVar('{$fpmf}'));
}
- // Check if {$table_name} exist before rendering the form and redirect, if there aren't {$table_name}
- if (\${$table_name}_count > 0) {
+ // Check if {$tableName} exist before rendering the form and redirect, if there aren't {$tableName}
+ if (\${$tableName}_count > 0) {
echo \$permform->render();
echo '<br /><br />';
} else {
- redirect_header ( '{$table_name}.php?op=new', 3, {$language}NOPERMSSET );
+ redirect_header ( '{$tableName}.php?op=new', 3, {$language}NOPERMSSET );
exit ();
}\n
PRM;
@@ -208,15 +208,15 @@
public function render() {
$module = $this->getModule();
$filename = $this->getFileName();
- $module_dirname = strtolower($module->getVar('mod_dirname'));
- $language = $this->getLanguage($module_dirname, 'AM');
+ $moduleDirname = $module->getVar('mod_dirname');
+ $language = $this->getLanguage($moduleDirname, 'AM');
$content = $this->getHeaderFilesComments($module, $filename);
- $content .= $this->getPermissionsCodeHeader($module_dirname, $language);
- $content .= $this->getPermissionsCodeSwitch($module_dirname, $language);
- $content .= $this->getPermissionsCodeBody($module_dirname, $language);
+ $content .= $this->getPermissionsCodeHeader($moduleDirname, $language);
+ $content .= $this->getPermissionsCodeSwitch($moduleDirname, $language);
+ $content .= $this->getPermissionsCodeBody($moduleDirname, $language);
$content .= $this->getPermissionsCodeFooter();
//
- $this->tdmcfile->create($module_dirname, 'admin', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ $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
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-02 19:27:17 UTC (rev 12671)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php 2014-07-03 22:42:40 UTC (rev 12672)
@@ -21,7 +21,7 @@
defined('XOOPS_ROOT_PATH') or die('Restricted access');
require_once 'structure.php';
/*include_once TDMC_PATH . '/include/functions.php';
-spl_autoload_register('TDMCreate_autoload');*/
+spl_autoload_register('tdmcreateAutoload');*/
class TDMCreateArchitecture extends TDMCreateStructure
{
@@ -40,7 +40,7 @@
/*
* @var mixed
*/
- private $upload_path = null;
+ private $uploadPath = null;
/*
* @public function constructor class
* @param null
@@ -73,7 +73,7 @@
* @param string $path
*/
public function getUploadPath($path) {
- $this->upload_path = $path;
+ $this->uploadPath = $path;
}
/*
* @public function createBaseFoldersFiles
@@ -82,32 +82,32 @@
public function createBaseFoldersFiles( $module )
{
// Module
- $mod_id = $module->getVar('mod_id');
+ $modId = $module->getVar('mod_id');
// Id of tables
- $criteria_tables = new CriteriaCompo();
- $criteria_tables->add(new Criteria('table_mid', $mod_id));
- $tables = $this->tdmcreate->getHandler('tables')->getObjects($criteria_tables);
- unset($criteria_tables);
+ $criteriaTables = new CriteriaCompo();
+ $criteriaTables->add(new Criteria('table_mid', $modId));
+ $tables = $this->tdmcreate->getHandler('tables')->getObjects($criteriaTables);
+ unset($criteriaTables);
//
$table = null;
foreach (array_keys($tables) as $t)
{
- $table_id = $tables[$t]->getVar('table_id');
- $table_name = $tables[$t]->getVar('table_name');
- $table_admin = $tables[$t]->getVar('table_admin');
- $table_user = $tables[$t]->getVar('table_user');
- $table_blocks = $tables[$t]->getVar('table_blocks');
- $table = $this->tdmcreate->getHandler('tables')->get($table_id);
+ $tableId = $tables[$t]->getVar('table_id');
+ $tableName = $tables[$t]->getVar('table_name');
+ $tableAdmin = $tables[$t]->getVar('table_admin');
+ $tableUser = $tables[$t]->getVar('table_user');
+ $tableBlocks = $tables[$t]->getVar('table_blocks');
+ $table = $this->tdmcreate->getHandler('tables')->get($tableId);
}
//
$indexFile = $this->path.'/index.html';
- $docs_folder = $this->path.'/docs';
- $logos_folder = $this->path.'/assets/images/logos';
- $stl_module_name = $module->getVar('mod_dirname');
- $stl_module_author = str_replace(' ', '', strtolower($module->getVar('mod_author')));
+ $docsFolder = $this->path.'/docs';
+ $logosFolder = $this->path.'/assets/images/logos';
+ $stlModuleDirname = $module->getVar('mod_dirname');
+ $stlModuleAuthor = str_replace(' ', '', strtolower($module->getVar('mod_author')));
// Creation of the Directory in repository
- $targetDirectory = $this->upload_path.'/repository/'. $stl_module_name;
- $upload_images_folder = $this->upload_path.'/images/repository';
+ $targetDirectory = $this->uploadPath.'/repository/'. $stlModuleDirname;
+ $uploadImagesFolder = $this->uploadPath.'/images/repository';
// Creation of "module" folder
$this->structure->getPath($targetDirectory);
@@ -134,8 +134,8 @@
// Creation of "images" folder and index.html file
$this->structure->makeDirAndCopyFile('assets/images', $indexFile, 'index.html');
//Copy the logo of the module
- $mod_image = str_replace(' ', '', strtolower($module->getVar('mod_image')));
- $this->structure->copyFile('assets/images', $upload_images_folder.'/'.$mod_image, $mod_image);
+ $modImage = str_replace(' ', '', strtolower($module->getVar('mod_image')));
+ $this->structure->copyFile('assets/images', $uploadImagesFolder.'/'.$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
@@ -143,26 +143,26 @@
// 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
- $logo_gif_from = $upload_images_folder.'/'.$stl_module_author.'_logo.gif';
- if (!file_exists($logo_gif_from)) {
- copy($logos_folder.'/'.$stl_module_author.'_logo.gif', $logo_gif_from);
+ $logoGifFrom = $uploadImagesFolder.'/'.$stlModuleAuthor.'_logo.gif';
+ if (!file_exists($logoGifFrom)) {
+ copy($logosFolder.'/'.$stlModuleAuthor.'_logo.gif', $logoGifFrom);
}
// Creation of 'module_author_logo.gif' file
- $this->structure->copyFile('assets/images', $logo_gif_from, $stl_module_author.'_logo.gif');
+ $this->structure->copyFile('assets/images', $logoGifFrom, $stlModuleAuthor.'_logo.gif');
// Creation of "images" folder and index.html file
$this->structure->makeDirAndCopyFile('assets/js', $indexFile, 'index.html');
// Creation of 'docs' folder and index.html file
$this->structure->makeDirAndCopyFile('docs', $indexFile, 'index.html');
// Creation of 'credits.txt' file
- $this->structure->copyFile('docs', $docs_folder.'/credits.txt', 'credits.txt');
+ $this->structure->copyFile('docs', $docsFolder.'/credits.txt', 'credits.txt');
// Creation of 'install.txt' file
- $this->structure->copyFile('docs', $docs_folder.'/install.txt', 'install.txt');
+ $this->structure->copyFile('docs', $docsFolder.'/install.txt', 'install.txt');
// Creation of 'lang_diff.txt' file
- $this->structure->copyFile('docs', $docs_folder.'/lang_diff.txt', 'lang_diff.txt');
+ $this->structure->copyFile('docs', $docsFolder.'/lang_diff.txt', 'lang_diff.txt');
// Creation of 'license.txt' file
- $this->structure->copyFile('docs', $docs_folder.'/license.txt', 'license.txt');
+ $this->structure->copyFile('docs', $docsFolder.'/license.txt', 'license.txt');
// Creation of 'readme.txt' file
- $this->structure->copyFile('docs', $docs_folder.'/readme.txt', 'readme.txt');
+ $this->structure->copyFile('docs', $docsFolder.'/readme.txt', 'readme.txt');
// Creation of "include" folder and index.html file
$this->structure->makeDirAndCopyFile('include', $indexFile, 'index.html');
// Creation of "language" folder and index.html file
@@ -196,87 +196,82 @@
}
/*
- * @public function createBuildingFiles
+ * @public function createFilesToBuilding
* @param string $module
*/
public function createFilesToBuilding( $module )
{
// Module
- $mod_id = $module->getVar('mod_id');
- $mod_dirname = $module->getVar('mod_dirname');
- $uploadTablesIcons32 = $this->upload_path.'/images/tables';
+ $modId = $module->getVar('mod_id');
+ $moduleDirname = $module->getVar('mod_dirname');
+ $uploadTablesIcons32 = $this->uploadPath.'/images/tables';
// Id of tables
- $criteria_tables = new CriteriaCompo();
- $criteria_tables->add(new Criteria('table_mid', $mod_id));
- $tables = $this->tdmcreate->getHandler('tables')->getObjects($criteria_tables);
- unset($criteria_tables);
+ $criteriaTables = new CriteriaCompo();
+ $criteriaTables->add(new Criteria('table_mid', $modId));
+ $tables = $this->tdmcreate->getHandler('tables')->getObjects($criteriaTables);
+ unset($criteriaTables);
$ret = array();
//
$table = null;
foreach (array_keys($tables) as $t)
{
- $table_mid = $tables[$t]->getVar('table_mid');
- $table_id = $tables[$t]->getVar('table_id');
- $table_name = $tables[$t]->getVar('table_name');
- $table_image = $tables[$t]->getVar('table_image');
- $table_admin = $tables[$t]->getVar('table_admin');
- $table_user = $tables[$t]->getVar('table_user');
- $table_blocks = $tables[$t]->getVar('table_blocks');
- $table_search = $tables[$t]->getVar('table_search');
- $table_comments = $tables[$t]->getVar('table_comments');
- $table_notifications = $tables[$t]->getVar('table_notifications');
- $table_permissions = $tables[$t]->getVar('table_permissions');
+ $tableMid = $tables[$t]->getVar('table_mid');
+ $tableId = $tables[$t]->getVar('table_id');
+ $tableName = $tables[$t]->getVar('table_name');
+ $tableImage = $tables[$t]->getVar('table_image');
+ $tableAdmin = $tables[$t]->getVar('table_admin');
+ $tableUser = $tables[$t]->getVar('table_user');
+ $tableBlocks = $tables[$t]->getVar('table_blocks');
+ $tableSearch = $tables[$t]->getVar('table_search');
+ $tableComments = $tables[$t]->getVar('table_comments');
+ $tableNotifications = $tables[$t]->getVar('table_notifications');
+ $tablePermissions = $tables[$t]->getVar('table_permissions');
// Get Table Object
- $table = $this->tdmcreate->getHandler('tables')->get($table_id);
+ $table = $this->tdmcreate->getHandler('tables')->get($tableId);
// Copy of tables images file
- if( file_exists($upload_table_image = $uploadTablesIcons32.'/'.$table_image)) {
- $this->structure->copyFile('assets/images/icons/32', $upload_table_image, $table_image);
+ if( file_exists($uploadTableImage = $uploadTablesIcons32.'/'.$tableImage)) {
+ $this->structure->copyFile('assets/images/icons/32', $uploadTableImage, $tableImage);
}
// Creation of admin files
- if ( $table_admin == 1) {
+ if ( $tableAdmin == 1) {
// Admin Pages File
$adminPages = AdminPages::getInstance();
$adminPages->write($module, $table);
- $ret[] = $adminPages->renderFile($table_name.'.php');
+ $ret[] = $adminPages->renderFile($tableName.'.php');
// Admin Templates File
$adminTemplatesPages = TemplatesAdminPages::getInstance();
$adminTemplatesPages->write($module, $table);
- $ret[] = $adminTemplatesPages->renderFile($mod_dirname.'_admin_'.$table_name.'.tpl');
+ $ret[] = $adminTemplatesPages->renderFile($moduleDirname.'_admin_'.$tableName.'.tpl');
}
// Creation of blocks
- if ( $table_blocks == 1) {
+ if ( $tableBlocks == 1) {
// Blocks Files
$blocksFiles = BlocksFiles::getInstance();
$blocksFiles->write($module, $table);
- $ret[] = $blocksFiles->renderFile($table_name.'.php');
+ $ret[] = $blocksFiles->renderFile($tableName.'.php');
// Templates Blocks Files
- $templatesFiles = TemplatesBlocks::getInstance();
- $templatesFiles->write($module, $table);
- $ret[] = $templatesFiles->renderFile($mod_dirname.'_block_'.$table_name.'.tpl');
- }
- // Blocks Templates File
- /*$blocksTemplates = BlocksTemplates::getInstance();
- $blocksTemplates->write($module, $table);
- $ret[] = $blocksTemplates->renderFile($table_name.'.tpl');*/
+ $templatesBlocks = TemplatesBlocks::getInstance();
+ $templatesBlocks->write($module, $table);
+ $ret[] = $templatesBlocks->renderFile($moduleDirname.'_block_'.$tableName.'.tpl');
+ }
// Creation of classes
- if ( $table_admin == 1 || $table_user == 1) {
+ if ( $tableAdmin == 1 || $tableUser == 1) {
// Class Files
$classFiles = ClassFiles::getInstance();
$classFiles->write($module, $table, $tables);
- $ret[] = $classFiles->renderFile($table_name.'.php');
+ $ret[] = $classFiles->renderFile($tableName.'.php');
}
// Creation of user files
- if ( $table_user == 1) {
+ if ( $tableUser == 1) {
// User Pages File
$userPages = UserPages::getInstance();
$userPages->write($module, $table);
- $ret[] = $userPages->renderFile($table_name.'.php');
+ $ret[] = $userPages->renderFile($tableName.'.php');
// User Templates File
$userTemplatesPages = TemplatesUserPages::getInstance();
$userTemplatesPages->write($module, $table);
- $ret[] = $userTemplatesPages->renderFile($mod_dirname.'_'.$table_name.'.tpl');
- }
- /*var_dump($table_name); */
+ $ret[] = $userTemplatesPages->renderFile($moduleDirname.'_'.$tableName.'.tpl');
+ }
}
// Language Modinfo File
$languageModinfo = LanguageModinfo::getInstance();
@@ -313,7 +308,7 @@
$ret[] = $adminPermissions->render();
// Templates Admin Permissions File
$adminTemplatesPermissions = TemplatesAdminPermissions::getInstance();
- $adminTemplatesPermissions->write($module, $mod_dirname.'_admin_permissions.tpl');
+ $adminTemplatesPermissions->write...
[truncated message content] |
|
From: <txm...@us...> - 2014-07-02 19:27:21
|
Revision: 12671
http://sourceforge.net/p/xoops/svn/12671
Author: txmodxoops
Date: 2014-07-02 19:27:17 +0000 (Wed, 02 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/classes/classes.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/admin/pages.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-02 16:54:58 UTC (rev 12670)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/pages.php 2014-07-02 19:27:17 UTC (rev 12671)
@@ -77,8 +77,13 @@
/*
* @public function getAdminPagesList
+ * @param string $module_dirname
* @param string $table_name
+ * @param string $table_fieldname
* @param string $language
+ * @param string $fields
+ * @param string $fpif
+ * @param string $fpmf
*/
public function getAdminPagesList($module_dirname, $table_name, $table_fieldname, $language, $fields, $fpif, $fpmf) {
$stu_module_dirname = strtoupper($module_dirname);
@@ -150,6 +155,7 @@
/*
* @public function getAdminPagesNew
+ * @param string $module_dirname
* @param string $table_name
* @param string $language
*/
@@ -171,8 +177,12 @@
/*
* @public function getAdminPagesSave
- * @param string $table_name
- * @param string $language
+ * @param string $module_dirname
+ * @param string $table_name
+ * @param string $language
+ * @param string $fields
+ * @param string $fpif
+ * @param string $fpmf
*/
public function getAdminPagesSave($module_dirname, $table_name, $language, $fields, $fpif, $fpmf)
{
@@ -230,15 +240,19 @@
/*
* @public function getAdminPagesEdit
- * @param string $table_name
+ * @param string $module_dirname
+ * @param string $table_name
+ * @param string $table_fieldname
* @param string $language
+ * @param string $fpif
*/
- public function getAdminPagesEdit($module_dirname, $table_name, $language, $fpif) {
+ public function getAdminPagesEdit($module_dirname, $table_name, $table_fieldname, $language, $fpif) {
$stu_table_name = strtoupper($table_name);
+ $stu_table_fieldname = strtoupper($table_fieldname);
$ret = <<<EOT
case 'edit':
\$template_main = '{$module_dirname}_admin_{$table_name}.tpl';
- \$adminMenu->addItemButton({$language}ADD_{$stu_table_name}, '{$table_name}.php?op=new', 'add');
+ \$adminMenu->addItemButton({$language}ADD_{$stu_table_fieldname}, '{$table_name}.php?op=new', 'add');
\$adminMenu->addItemButton({$language}{$stu_table_name}_LIST, '{$table_name}.php', 'list');
echo \$adminMenu->renderButton();
// Get Form
@@ -317,7 +331,7 @@
$content .= $this->getAdminPagesList($module_dirname, $table_name, $table_fieldname, $language, $fields, $fpif, $fpmf);
$content .= $this->getAdminPagesNew($module_dirname, $table_name, $language);
$content .= $this->getAdminPagesSave($module_dirname, $table_name, $language, $fields, $fpif, $fpmf);
- $content .= $this->getAdminPagesEdit($module_dirname, $table_name, $language, $fpif);
+ $content .= $this->getAdminPagesEdit($module_dirname, $table_name, $table_fieldname, $language, $fpif);
$content .= $this->getAdminPagesDelete($table_name, $language, $fpif, $fpmf);
$content .= $this->getAdminPagesFooter();
//
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-02 16:54:58 UTC (rev 12670)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/classes/classes.php 2014-07-02 19:27:17 UTC (rev 12671)
@@ -144,7 +144,7 @@
/*
* @var mixed
*/
- private {$module_dirname} = null;
+ private \${$module_dirname} = null;
/*
* Constructor
*
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-02 16:54:58 UTC (rev 12670)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/admin/pages.php 2014-07-02 19:27:17 UTC (rev 12671)
@@ -76,6 +76,7 @@
EOT;
}
$ret .= <<<EOT
+ <th class="center"><{\$smarty.const.{$language}FORMACTION}></th>
</tr>
</thead>\n
EOT;
@@ -102,12 +103,22 @@
$field_name = $fields[$f]->getVar('field_name');
$field_element = $fields[$f]->getVar('field_element');
$rp_field_name = $field_name;
+ if($f == 0) {
+ $field_id = $field_name;
+ if(strpos($field_name, '_')) {
+ $str = strpos($field_name, '_');
+ if($str !== false) {
+ $rp_field_id = substr($field_name, $str + 1, strlen($field_name));
+ }
+ }
+ }
if(strpos($field_name, '_')) {
$str = strpos($field_name, '_');
if($str !== false) {
$rp_field_name = substr($field_name, $str + 1, strlen($field_name));
}
}
+ $lp_field_name = substr($field_name, 0, strpos($field_name, '_'));
switch( $field_element ) {
case 8:
$ret .= <<<EOT
@@ -127,6 +138,14 @@
}
}
$ret .= <<<EOT
+ <td class="center">
+ <a href="{$table_name}.php?op=edit&{$field_id}=<{\$list.{$rp_field_id}}>" title="<{\$smarty.const._EDIT}>">
+ <img src="<{xoModuleIcons16 edit.png}>" alt="<{\$smarty.const._EDIT}>" />
+ </a>
+ <a href="{$table_name}.php?op=delete&{$field_id}=<{\$list.{$rp_field_id}}>" title="<{\$smarty.const._DELETE}>">
+ <img src="<{xoModuleIcons16 delete.png}>" alt="<{\$smarty.const._DELETE}>" />
+ </a>
+ </td>
</tr>
<{/foreach}>
</tbody>
|
|
From: <txm...@us...> - 2014-07-02 16:55:08
|
Revision: 12670
http://sourceforge.net/p/xoops/svn/12670
Author: txmodxoops
Date: 2014-07-02 16:54:58 +0000 (Wed, 02 Jul 2014)
Log Message:
-----------
- Fixed 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/classes/formelements.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/xoops_version.php
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-02 16:00:01 UTC (rev 12669)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/classes/classes.php 2014-07-02 16:54:58 UTC (rev 12670)
@@ -142,6 +142,10 @@
class {$ucf_module_dirname}{$ucf_table_name} extends XoopsObject
{
/*
+ * @var mixed
+ */
+ private {$module_dirname} = null;
+ /*
* Constructor
*
* @param null
@@ -188,12 +192,12 @@
if (\$action === false) {
\$action = \$_SERVER['REQUEST_URI'];
}
-
+ // Title
\$title = \$this->isNew() ? sprintf({$language}{$stu_table_name}_ADD) : sprintf({$language}{$stu_table_name}_EDIT);
-
+ // Get Theme Form
xoops_load('XoopsFormLoader');
\$form = new XoopsThemeForm(\$title, 'form', \$action, 'post', true);
- \$form->setExtra('enctype="multipart/form-data"');\n
+ \$form->setExtra('enctype="multipart/form-data"');
{$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-02 16:00:01 UTC (rev 12669)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/classes/formelements.php 2014-07-02 16:54:58 UTC (rev 12670)
@@ -58,7 +58,9 @@
* @param string $required
*/
private function getXoopsFormText($language, $field_name, $required = 'false') {
+
$ret = <<<EOT
+ // Form Text {$field_name}
\$form->addElement( new XoopsFormText({$language}, '{$field_name}', 50, 255, \$this->getVar('{$field_name}')){$required} );\n
EOT;
return $ret;
@@ -71,6 +73,7 @@
*/
private function getXoopsFormTextArea($language, $field_name, $required = 'false') {
$ret = <<<EOT
+ // Form Text Area
\$form->addElement( new XoopsFormTextArea({$language}, '{$field_name}', \$this->getVar('{$field_name}'), 4, 47){$required} );\n
EOT;
return $ret;
@@ -84,6 +87,7 @@
*/
private function getXoopsFormDhtmlTextArea($language, $module_dirname, $field_name, $required = 'false') {
$ret = <<<EOT
+ // Form Dhtml Text Area
\$editor_configs = array();
\$editor_configs['name'] = '{$field_name}';
\$editor_configs['value'] = \$this->getVar('{$field_name}', 'e');
@@ -104,6 +108,7 @@
*/
private function getXoopsFormCheckBox($language, $field_name, $required = 'false') {
$ret = <<<EOT
+ // Form Check Box
\${$field_name} = \$this->isNew() ? 0 : \$this->getVar('{$field_name}');
\$check_{$field_name} = new XoopsFormCheckBox({$language}, '{$field_name}', \${$field_name});
\$check_{$field_name}->addOption(1, " ");
@@ -117,6 +122,7 @@
*/
private function getXoopsFormHidden($field_name) {
$ret = <<<EOT
+ // Form Hidden
\$form->addElement( new XoopsFormHidden('{$field_name}', \$this->getVar('{$field_name}')) );\n
EOT;
return $ret;
@@ -129,6 +135,7 @@
*/
private function getXoopsFormUploadFile($language, $module_dirname, $field_name, $required = 'false') {
$ret = <<<EOT
+ // Form file
\$form->addElement( new XoopsFormFile({$language}, '{$field_name}', \$this->{$module_dirname}->getConfig('maxsize')){$required} );\n
EOT;
return $ret;
@@ -143,25 +150,17 @@
private function getXoopsFormUploadImage($language, $module_dirname, $table_name, $field_name, $required = 'false') {
$stu_field_name = strtoupper($field_name);
$ret = <<<EOT
- //\$form->addElement(new XoopsFormImage({$language}, '{$field_name}', \$this->{$module_dirname}->getConfig('maxsize')){$required});
+ // Form image file
\$get_{$field_name} = \$this->getVar('{$field_name}');
\${$field_name} = \$get_{$field_name} ? \$get_{$field_name} : 'blank.gif';
\$iconsdir = '/Frameworks/moduleclasses/icons/32';
\$uploads_dir = '/uploads/'.\$GLOBALS['xoopsModule']->dirname().'/images/{$table_name}';
- if(is_dir(XOOPS_ROOT_PATH . \$iconsdir)){
- \$iconsdirectory = \$iconsdir;
- }else{
- \$iconsdirectory = \$uploads_dir;
- }
+ \$iconsdirectory = is_dir(XOOPS_ROOT_PATH . \$iconsdir) ? \$iconsdir : \$uploads_dir;
//
- \$imgtray1 = new XoopsFormElementTray({$language}{$stu_field_name},'<br />');
- if(is_dir(XOOPS_ROOT_PATH . \$iconsdir)) {
- \$imgpath = sprintf({$language}FORMIMAGE_PATH, ".{\$iconsdir}/");
- }else{
- \$imgpath = sprintf({$language}FORMIMAGE_PATH, \$uploads_dir);
- }
- \$imgpath1 = sprintf({$language}FORMIMAGE_PATH, ".{\$iconsdirectory}/");
- \$imageselect1 = new XoopsFormSelect(\$imgpath1, '{$field_name}', \${$field_name}, 10);
+ \$imgtray1 = new XoopsFormElementTray({$language}{$stu_field_name},'<br />');
+ \$imgpath = is_dir(XOOPS_ROOT_PATH . \$iconsdir) ? sprintf({$language}FORMIMAGE_PATH, ".{\$iconsdir}/") : sprintf({$language}FORMIMAGE_PATH, \$uploads_dir);
+ //\$imgpath1 = sprintf({$language}FORMIMAGE_PATH, ".{\$iconsdirectory}/");
+ \$imageselect1 = new XoopsFormSelect(\$imgpath, '{$field_name}', \${$field_name}, 10);
\$image_array1 = XoopsLists::getImgListAsArray( XOOPS_ROOT_PATH . \$iconsdirectory );
foreach( \$image_array1 as \$image1 ) {
\$imageselect1->addOption("{\$image1}", \$image1);
@@ -169,6 +168,7 @@
\$imageselect1->setExtra( "onchange='showImgSelected(\"image1\", \"{$field_name}\", \"".\$iconsdirectory."\", \"\", \"".XOOPS_URL."\")'" );
\$imgtray1->addElement(\$imageselect1, false);
\$imgtray1->addElement( new XoopsFormLabel( '', "<br /><img src='".XOOPS_URL."/".\$iconsdirectory."/".\${$field_name}."' name='image1' id='image1' alt='' />" ) );
+ // Form File
\$fileseltray1 = new XoopsFormElementTray('','<br />');
\$fileseltray1->addElement(new XoopsFormFile({$language}FORMUPLOAD , 'attachedfile', \$this->{$module_dirname}->getConfig('maxsize')));
\$fileseltray1->addElement(new XoopsFormLabel(''));
@@ -185,6 +185,7 @@
*/
private function getXoopsFormColorPicker($language, $module_dirname, $field_name, $required = 'false') {
$ret = <<<EOT
+ // Form Color Picker
\$form->addElement( new XoopsFormColorPicker({$language}, '{$field_name}', \$this->{$module_dirname}->getConfig('maxsize')){$required} );\n
EOT;
return $ret;
@@ -198,6 +199,7 @@
*/
private function getXoopsFormSelect($language, $table_name, $field_name, $required = 'false') {
$ret = <<<EOT
+ // Form Select
\${$field_name}_select = new XoopsFormSelect({$language}, '{$field_name}', \$this->getVar('{$field_name}'));
\${$field_name}_select->addOption('Empty');
\${$field_name}_select->addOptionArray({$table_name}Handler->getList());
@@ -213,6 +215,7 @@
*/
private function getXoopsFormSelectUser($language, $field_name, $required = 'false') {
$ret = <<<EOT
+ // Form Select User
\$form->addElement( new XoopsFormSelectUser({$language}, '{$field_name}', false, \$this->getVar('{$field_name}'), 1, false){$required} );\n
EOT;
return $ret;
@@ -225,6 +228,7 @@
*/
private function getXoopsFormRadioYN($language, $field_name, $required = 'false') {
$ret = <<<EOT
+ // Form Radio Yes/No
${$field_name} = \$this->isNew() ? 0 : \$this->getVar('{$field_name}');
\$form->addElement( new XoopsFormRadioYN({$language}, '{$field_name}', ${$field_name}){$required} );\n
EOT;
@@ -238,6 +242,7 @@
*/
private function getXoopsFormTextDateSelect($language, $module_dirname, $field_name, $required = 'false') {
$ret = <<<EOT
+ // Form Text Date Select
\$form->addElement( new XoopsFormTextDateSelect({$language}, '{$field_name}', '', \$this->getVar('{$field_name}')){$required} );\n
EOT;
return $ret;
@@ -260,6 +265,7 @@
}
}
$ret = <<<EOT
+ // Form Table
\${$table_name}Handler =& \$this->{$module_dirname}->getHandler('{$table_name}');
\${$field_name}_select = new XoopsFormSelect({$language}, '{$field_name}', \$this->getVar('{$field_name}'));
\${$field_name}_select->addOptionArray(\${$field_name}Handler->getList());
@@ -278,6 +284,7 @@
private function getXoopsFormTopic($language, $module_dirname, $table, $fields, $required = 'false')
{
$table_name = $table->getVar('table_name');
+ $ucf_table_name = ucfirst($table_name);
foreach(array_keys($fields) as $f)
{
$field_name = $fields[$f]->getVar('field_name');
@@ -292,6 +299,7 @@
}
}
$ret = <<<EOT
+ // Form Topic {$ucf_table_name}
include_once(XOOPS_ROOT_PATH . '/class/tree.php');
\${$table_name}Handler = \$this->{$module_dirname}->getHandler('{$table_name}');
\$criteria = new CriteriaCompo();
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/xoops_version.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/xoops_version.php 2014-07-02 16:00:01 UTC (rev 12669)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/xoops_version.php 2014-07-02 16:54:58 UTC (rev 12670)
@@ -420,5 +420,5 @@
$modversion['config'][$i]['description'] = "";
$modversion['config'][$i]['formtype'] = "textbox";
$modversion['config'][$i]['valuetype'] = "text";
-$modversion['config'][$i]['default'] = '12662';
+$modversion['config'][$i]['default'] = '12670';
unset($i);
\ No newline at end of file
|
|
From: <txm...@us...> - 2014-07-02 16:00:05
|
Revision: 12669
http://sourceforge.net/p/xoops/svn/12669
Author: txmodxoops
Date: 2014-07-02 16:00:01 +0000 (Wed, 02 Jul 2014)
Log Message:
-----------
- Fixed several bugs
- 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/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/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/admin/permissions.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-02 08:52:43 UTC (rev 12668)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/menu.php 2014-07-02 16:00:01 UTC (rev 12669)
@@ -86,7 +86,9 @@
$content .= <<<EOT
\$adminmenu[\$i]['title'] = {$language}{$menu};
\$adminmenu[\$i]['link'] = 'admin/{$tables[$i]->getVar('table_name')}.php';
-\$adminmenu[\$i]['icon'] = 'assets/images/32/{$tables[$i]->getVar('table_image')}';
+\$adminmenu[\$i]['icon'] = \$sysPathIcon32.'/{$tables[$i]->getVar('table_image')}';
+// Local path
+//\$adminmenu[\$i]['icon'] = 'assets/images/icons/32/{$tables[$i]->getVar('table_image')}';
\$i++;\n
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-02 08:52:43 UTC (rev 12668)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php 2014-07-02 16:00:01 UTC (rev 12669)
@@ -230,7 +230,7 @@
$table = $this->tdmcreate->getHandler('tables')->get($table_id);
// Copy of tables images file
if( file_exists($upload_table_image = $uploadTablesIcons32.'/'.$table_image)) {
- $this->structure->copyFile('assets/images/32', $upload_table_image, $table_image);
+ $this->structure->copyFile('assets/images/icons/32', $upload_table_image, $table_image);
}
// Creation of admin files
if ( $table_admin == 1) {
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-02 08:52:43 UTC (rev 12668)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/classes/classes.php 2014-07-02 16:00:01 UTC (rev 12669)
@@ -194,7 +194,7 @@
xoops_load('XoopsFormLoader');
\$form = new XoopsThemeForm(\$title, 'form', \$action, 'post', true);
\$form->setExtra('enctype="multipart/form-data"');\n
-{$this->formelements->renderElements()}\n
+{$this->formelements->renderElements()}
EOT;
return $ret;
}
@@ -228,8 +228,7 @@
\$groups_can_approve_checkbox = new XoopsFormCheckBox ( {$perm_approve}, 'groups_approve[]', \$full_list );
\$groups_can_submit_checkbox = new XoopsFormCheckBox ( {$perm_submit}, 'groups_submit[]', \$full_list );
\$groups_can_view_checkbox = new XoopsFormCheckBox ( {$perm_view}, 'groups_view[]', \$full_list );
- }
-
+ }
// For approve
\$groups_can_approve_checkbox->addOptionArray ( \$group_list );
\$form->addElement ( \$groups_can_approve_checkbox );
@@ -238,7 +237,7 @@
\$form->addElement ( \$groups_can_submit_checkbox );
// For view
\$groups_can_view_checkbox->addOptionArray ( \$group_list );
- \$form->addElement ( \$groups_can_view_checkbox );\n\n
+ \$form->addElement ( \$groups_can_view_checkbox );\n
EOT;
return $ret;
}
@@ -248,6 +247,7 @@
*/
private function getFootFunctionForm() {
$ret = <<<EOT
+ // Send
\$form->addElement(new XoopsFormHidden('op', 'save'));
\$form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
return \$form;
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-02 08:52:43 UTC (rev 12668)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/classes/formelements.php 2014-07-02 16:00:01 UTC (rev 12669)
@@ -199,6 +199,7 @@
private function getXoopsFormSelect($language, $table_name, $field_name, $required = 'false') {
$ret = <<<EOT
\${$field_name}_select = new XoopsFormSelect({$language}, '{$field_name}', \$this->getVar('{$field_name}'));
+ \${$field_name}_select->addOption('Empty');
\${$field_name}_select->addOptionArray({$table_name}Handler->getList());
\$form->addElement( \${$field_name}_select{$required} );\n
EOT;
@@ -258,12 +259,12 @@
$field_name = $fields[$f]->getVar('field_name');
}
}
- $ret = <<<XFT
+ $ret = <<<EOT
\${$table_name}Handler =& \$this->{$module_dirname}->getHandler('{$table_name}');
\${$field_name}_select = new XoopsFormSelect({$language}, '{$field_name}', \$this->getVar('{$field_name}'));
\${$field_name}_select->addOptionArray(\${$field_name}Handler->getList());
\$form->addElement( \${$field_name}_select{$required} );\n
-XFT;
+EOT;
return $ret;
}
/*
@@ -274,12 +275,13 @@
* @param string $fields
* @param string $required
*/
- private function getXoopsFormTopic($language, $module_dirname, $table_name, $fields, $required = 'false')
+ private function getXoopsFormTopic($language, $module_dirname, $table, $fields, $required = 'false')
{
+ $table_name = $table->getVar('table_name');
foreach(array_keys($fields) as $f)
{
$field_name = $fields[$f]->getVar('field_name');
- if($fields[$f]->getVar('field_id') == 1) {
+ if(($f == 0) && ($table->getVar('table_autoincrement') == 1)) {
$field_id = $field_name;
}
if($fields[$f]->getVar('field_parent') == 1) {
@@ -289,17 +291,17 @@
$field_main = $field_name;
}
}
- $ret = <<<XFT
+ $ret = <<<EOT
include_once(XOOPS_ROOT_PATH . '/class/tree.php');
\${$table_name}Handler = \$this->{$module_dirname}->getHandler('{$table_name}');
\$criteria = new CriteriaCompo();
\${$table_name} = \${$table_name}Handler->getObjects( \$criteria );
if(\${$table_name}) {
\${$table_name}_tree = new XoopsObjectTree( \${$table_name}, '{$field_id}', '{$field_pid}' );
- \${$field_pid} = \${$table_name}_tree->makeSelBox( '{$field_pid}', '{$field_main}','--', \$this->getVar('{$field_pid}', 'e' ), true );
+ \${$field_pid} = \${$table_name}_tree->makeSelBox( '{$field_pid}', '{$field_main}', '--', \$this->getVar('{$field_pid}', 'e' ), true );
\$form->addElement( new XoopsFormLabel ( {$language}, \${$field_pid} ){$required} );
- }\n
-XFT;
+ }\n
+EOT;
return $ret;
}
/*
@@ -323,57 +325,57 @@
$language = $language_funct . strtoupper($field_name);
$required = ( $fields[$f]->getVar('field_required') == 1 ) ? ', true' : '';
//
- if($field_inform == 1) {
- // If we want to hide XoopsFormHidden() or field id
- //if(($f > 0) && ($table->getVar('table_autoincrement') == 1)) {
- // Switch elements
- switch($field_element)
- {
- case 1:
- $ret .= $this->getXoopsFormText($language, $field_name, $required);
- break;
- case 2:
- $ret .= $this->getXoopsFormTextArea($language, $field_name, $required);
- break;
- case 3:
- $ret .= $this->getXoopsFormDhtmlTextArea($language, $module_dirname, $field_name, $required);
- break;
- case 4:
- $ret .= $this->getXoopsFormCheckBox($language, $field_name, $required);
- break;
- case 5:
- $ret .= $this->getXoopsFormRadioYN($language, $field_name, $required);
- break;
- case 6:
- $ret .= $this->getXoopsFormSelect($language, $table_name, $field_name, $required);
- break;
- case 7:
- $ret .= $this->getXoopsFormSelectUser($language, $field_name, $required);
- break;
- case 8:
- $ret .= $this->getXoopsFormColorPicker($language, $module_dirname, $field_name, $required);
- break;
- case 9:
- $ret .= $this->getXoopsFormUploadImage($language_funct, $module_dirname, $table_name, $field_name, $required);
- break;
- case 10:
- $ret .= $this->getXoopsFormUploadFile($language, $module_dirname, $field_name, $required);
- break;
- case 11:
- $ret .= $this->getXoopsFormTextDateSelect($language, $module_dirname, $field_name, $required);
- break;
- default:
- $ret .= $this->getXoopsFormHidden($field_name);
- break;
+ if($field_inform == 1) {
+ // Switch elements
+ switch($field_element)
+ {
+ case 1:
+ $ret .= $this->getXoopsFormText($language, $field_name, $required);
+ break;
+ case 2:
+ $ret .= $this->getXoopsFormTextArea($language, $field_name, $required);
+ break;
+ case 3:
+ $ret .= $this->getXoopsFormDhtmlTextArea($language, $module_dirname, $field_name, $required);
+ break;
+ case 4:
+ $ret .= $this->getXoopsFormCheckBox($language, $field_name, $required);
+ break;
+ case 5:
+ $ret .= $this->getXoopsFormRadioYN($language, $field_name, $required);
+ break;
+ case 6:
+ $ret .= $this->getXoopsFormSelect($language, $table_name, $field_name, $required);
+ break;
+ case 7:
+ $ret .= $this->getXoopsFormSelectUser($language, $field_name, $required);
+ break;
+ case 8:
+ $ret .= $this->getXoopsFormColorPicker($language, $module_dirname, $field_name, $required);
+ break;
+ case 9:
+ $ret .= $this->getXoopsFormUploadImage($language_funct, $module_dirname, $table_name, $field_name, $required);
+ break;
+ case 10:
+ $ret .= $this->getXoopsFormUploadFile($language, $module_dirname, $field_name, $required);
+ break;
+ case 11:
+ $ret .= $this->getXoopsFormTextDateSelect($language, $module_dirname, $field_name, $required);
+ break;
+ default:
+ // If we want to hide XoopsFormHidden() or field id
+ if(($f == 0) && ($table->getVar('table_autoincrement') == 1)) {
+ $ret .= $this->getXoopsFormHidden($field_name);
+ }
+ break;
+ }
+ if ($field_element > 11) {
+ if($table->getVar('table_category') == 1) {
+ $ret .= $this->getXoopsFormTopic($language, $module_dirname, $table, $fields, $required);
+ } else {
+ $ret .= $this->getXoopsFormTable($language, $module_dirname, $table_name, $fields, $required);
}
- if ($field_element > 11) {
- if($table->getVar('table_category') == 1) {
- $ret .= $this->getXoopsFormTopic($language, $module_dirname, $table_name, $fields, $required);
- } else {
- $ret .= $this->getXoopsFormTable($language, $module_dirname, $table_name, $fields, $required);
- }
- }
- //}
+ }
}
}
return $ret;
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-02 08:52:43 UTC (rev 12668)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql/mysql.php 2014-07-02 16:00:01 UTC (rev 12669)
@@ -318,7 +318,7 @@
$module = $this->getModule();
$filename = $this->getFileName();
$module_name = strtolower($module->getVar('mod_name'));
- $module_dirname = strtolower($module->getVar('mod_name'));
+ $module_dirname = strtolower($module->getVar('mod_dirname'));
$content = $this->getHeaderSqlComments($module_name);
$content .= $this->getDatabaseTables($module_dirname);
$this->tdmcfile->create($module_dirname, 'sql', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
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-02 08:52:43 UTC (rev 12668)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/admin/pages.php 2014-07-02 16:00:01 UTC (rev 12669)
@@ -213,7 +213,7 @@
public function renderFile($filename) {
$module = $this->getModule();
$table = $this->getTable();
- $module_dirname = $module->getVar('mod_name');
+ $module_dirname = $module->getVar('mod_dirname');
$table_name = $table->getVar('table_name');
$table_fieldname = $table->getVar('table_fieldname');
$language = $this->getLanguage($module_dirname, 'AM');
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/admin/permissions.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/admin/permissions.php 2014-07-02 08:52:43 UTC (rev 12668)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/admin/permissions.php 2014-07-02 16:00:01 UTC (rev 12669)
@@ -69,7 +69,7 @@
public function render() {
$module = $this->getModule();
$filename = $this->getFileName();
- $module_dirname = $module->getVar('mod_name');
+ $module_dirname = $module->getVar('mod_dirname');
$language = $this->getLanguage($module_dirname, 'AM');
$content = $this->getTemplatesAdminPermissions($module_dirname);
//
|
|
From: <txm...@us...> - 2014-07-02 08:52:49
|
Revision: 12668
http://sourceforge.net/p/xoops/svn/12668
Author: txmodxoops
Date: 2014-07-02 08:52:43 +0000 (Wed, 02 Jul 2014)
Log Message:
-----------
- Fixed bugs
- Updated
- Solved issue for upload file image in modules.php and tables.php - admin
- Still work to do
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/assets/js/functions.js
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php
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/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/user/xoopsversion.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/logoGenerator.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/modules.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/admin.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_fields.tpl
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_tables.tpl
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php 2014-07-01 14:18:13 UTC (rev 12667)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php 2014-07-02 08:52:43 UTC (rev 12668)
@@ -143,7 +143,7 @@
$GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
// Form Add
$fieldsObj =& $tdmcreate->getHandler('fields')->create();
- $form = $fieldsObj->getFormAdd($field_mid, $field_tid, $field_numb, $field_name);
+ $form = $fieldsObj->getFormNew($field_mid, $field_tid, $field_numb, $field_name);
$GLOBALS['xoopsTpl']->assign('form', $form->render());
// Test -> Will be removed
var_dump($field_mid);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php 2014-07-01 14:18:13 UTC (rev 12667)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php 2014-07-02 08:52:43 UTC (rev 12668)
@@ -101,9 +101,10 @@
} else {
$obj =& $tdmcreate->getHandler('modules')->create();
}
+ $mod_dirname = preg_replace('/[^a-zA-Z0-9]\s+/', '', strtolower($_POST['mod_dirname']));
//Form module save
$obj->setVars(array('mod_name' => $_POST['mod_name'],
- 'mod_dirname' => preg_replace('/[^a-zA-Z0-9]\s+/', '', strtolower($_POST['mod_dirname'])),
+ 'mod_dirname' => $mod_dirname,
'mod_version' => $_POST['mod_version'],
'mod_since' => $_POST['mod_since'],
'mod_min_php' => $_POST['mod_min_php'],
@@ -126,9 +127,9 @@
$uploader = new XoopsMediaUploader(TDMC_UPLOAD_IMGMOD_PATH, $tdmcreate->getConfig('mimetypes'),
$tdmcreate->getConfig('maxsize'), null, null);
if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) {
- $extension = preg_replace( '/^.+\.([^.]+)$/sU' , '\\1' , $_FILES['attachedfile']['name']);
- $name_img = strtolower($_POST['mod_name']).'_slogo.'.$extension;
- $uploader->setPrefix($name_img);
+ /*$extension = preg_replace( '/.*\.([^.]+)$/', '\\1', $_FILES['attachedfile']['name']);
+ $logo_image = $mod_dirname.'_slogo.'.$extension;
+ $uploader->setPrefix($logo_image);*/
$uploader->fetchMedia($_POST['xoops_upload_file'][0]);
if (!$uploader->upload()) {
$errors = $uploader->getErrors();
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php 2014-07-01 14:18:13 UTC (rev 12667)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php 2014-07-02 08:52:43 UTC (rev 12668)
@@ -24,14 +24,10 @@
//
$mod_id = XoopsRequest::getInt('mod_id');
//
-$table_id = TDMCreate_CleanVars($_REQUEST, 'table_id');
-$table_mid = TDMCreate_CleanVars($_REQUEST, 'table_mid');
-$table_nbfields = TDMCreate_CleanVars($_REQUEST, 'table_nbfields');
-$table_fieldname = TDMCreate_CleanVars($_REQUEST, 'table_fieldname', '', 'string');
-/*$table_id = XoopsRequest::getInt('table_id');
+$table_id = XoopsRequest::getInt('table_id');
$table_mid = XoopsRequest::getInt('table_mid');
$table_nbfields = XoopsRequest::getInt('table_nbfields');
-$table_fieldname = XoopsRequest::getString('table_fieldname', '');*/
+$table_fieldname = XoopsRequest::getString('table_fieldname', '');
//
switch ($op)
{
@@ -48,8 +44,10 @@
$GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
$GLOBALS['xoopsTpl']->assign('tdmc_url', TDMC_URL);
$GLOBALS['xoopsTpl']->assign('tdmc_icons_url', TDMC_ICONS_URL);
- $GLOBALS['xoopsTpl']->assign('tdmc_upload_imgmod_url', TDMC_UPLOAD_IMGMOD_URL);
- $GLOBALS['xoopsTpl']->assign('tdmc_upload_imgtab_url', TDMC_UPLOAD_IMGTAB_URL);
+ $GLOBALS['xoopsTpl']->assign('tdmc_upload_imgmod_url', TDMC_UPLOAD_IMGMOD_URL);
+ /*$tdmc_upload_image_url = is_dir($sysPathIcon32) ? $sysPathIcon32 : TDMC_UPLOAD_IMGTAB_PATH;
+ $GLOBALS['xoopsTpl']->assign('tdmc_table_image_url', $tdmc_upload_image_url);*/
+ $GLOBALS['xoopsTpl']->assign('tdmc_upload_imgtab_url', TDMC_UPLOAD_IMGTAB_URL);
$GLOBALS['xoopsTpl']->assign('modPathIcon16', $modPathIcon16);
$GLOBALS['xoopsTpl']->assign('sysPathIcon32', $sysPathIcon32);
// Get the list of modules
@@ -175,13 +173,11 @@
'table_fieldname' => $table_fieldname));
//Form table_image
include_once XOOPS_ROOT_PATH.'/class/uploader.php';
- $uploaddir = is_dir($sysPathIcon32) ? $sysPathIcon32 : TDMC_UPLOAD_IMGTAB_PATH;
+ $framePathIcon32 = XOOPS_ROOT_PATH . '/Frameworks/moduleclasses/icons/32';
+ $uploaddir = is_dir($framePathIcon32) ? $framePathIcon32 : TDMC_UPLOAD_IMGTAB_PATH;
$uploader = new XoopsMediaUploader($uploaddir, $tdmcreate->getConfig('mimetypes'),
$tdmcreate->getConfig('maxsize'), null, null);
- if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) {
- $extension = preg_replace( '/^.+\.([^.]+)$/sU' , '\\1' , $_FILES['attachedfile']['name']);
- $name_img = $_POST['table_name'].'.'.$extension;
- $uploader->setPrefix($name_img);
+ if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) {
$uploader->fetchMedia($_POST['xoops_upload_file'][0]);
if (!$uploader->upload()) {
$errors = $uploader->getErrors();
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/js/functions.js
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/js/functions.js 2014-07-01 14:18:13 UTC (rev 12667)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/js/functions.js 2014-07-02 08:52:43 UTC (rev 12668)
@@ -47,7 +47,7 @@
function createNewModuleLogo(xoopsUrl) { // this is JavaScript function
iconDom = xoopsGetElementById(image4);
iconName = iconDom.src;
- str = xoopsGetElementById(mod_name).value;
+ str = xoopsGetElementById(mod_dirname).value;
res = str.toLowerCase();
caption = res.replace(' ', '');
logoDom = xoopsGetElementById(image3);
@@ -63,7 +63,7 @@
//alert(data1);
logoDom.src = data1.split('\n')[0];//the data returned has too many lines. We need only the link to the image
logoDom.load; //refresh the logo
- mycheck=caption+'_logo.png'; //name of the new logo file
+ mycheck=caption+'_slogo.png'; //name of the new logo file
//if file is not in the list of logo files, add it to the dropdown menu
var fileExist;
elems = moduleImageDom.options;
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php 2014-07-01 14:18:13 UTC (rev 12667)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php 2014-07-02 08:52:43 UTC (rev 12668)
@@ -88,29 +88,27 @@
}
/*
- * @public function getFormAdd
- *
- * @param integer $field_mid
- * @param integer $field_tid
- * @param integer $field_numb
- * @param string $f_name
+ * @private function getHeaderForm
* @param mixed $action
*/
- public function getFormAdd($field_mid = null, $field_tid = null, $field_numb = null, $f_name = null, $action = false)
+ private function getHeaderForm($action = false)
{
if ($action === false) {
$action = $_SERVER['REQUEST_URI'];
}
+ $isNew = $this->isNew();
+ $title = $isNew ? sprintf(_AM_TDMCREATE_FIELDS_NEW) : sprintf(_AM_TDMCREATE_FIELDS_EDIT);
+
$form = new TDMCreateThemeForm(null, 'form', $action, 'post', true);
$form->setExtra('enctype="multipart/form-data"');
-
+
// New Object HtmlTable
$form->addElement(new TDMCreateFormLabel('<table border="0" cellspacing="1" class="outer width100">'));
- $form->addElement(new TDMCreateFormLabel('<thead class="center">'));
- $form->addElement(new TDMCreateFormLabel('<tr class="head"><th colspan="9">'._AM_TDMCREATE_FIELD_ADD.'</th></tr>'));
+ $form->addElement(new TDMCreateFormLabel('<thead class="center">'));
+ $form->addElement(new TDMCreateFormLabel('<tr class="head"><th colspan="9">'.$title.'</th></tr>'));
$form->addElement(new TDMCreateFormLabel('<tr class="head width5">'));
- $form->addElement(new TDMCreateFormLabel('<td>'._AM_TDMCREATE_FIELD_NUMBER.'</td>'));
+ $form->addElement(new TDMCreateFormLabel('<td>'._AM_TDMCREATE_FIELD_ID.'</td>'));
$form->addElement(new TDMCreateFormLabel('<td>'._AM_TDMCREATE_FIELD_NAME.'</td>'));
$form->addElement(new TDMCreateFormLabel('<td>'._AM_TDMCREATE_FIELD_TYPE.'</td>'));
$form->addElement(new TDMCreateFormLabel('<td>'._AM_TDMCREATE_FIELD_VALUE.'</th>'));
@@ -120,7 +118,26 @@
$form->addElement(new TDMCreateFormLabel('<td>'._AM_TDMCREATE_FIELD_KEY.'</th>'));
$form->addElement(new TDMCreateFormLabel('<td>'._AM_TDMCREATE_FIELD_PARAMETERS.'</th>'));
$form->addElement(new TDMCreateFormLabel('</tr></thead>'));
- $form->addElement(new TDMCreateFormLabel('<tbody>'));
+ $form->addElement(new TDMCreateFormLabel('<tbody>'));
+ //
+ 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';
@@ -228,17 +245,10 @@
$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>'));
- }
+ }
}
- // Send Form Data
- $form->addElement(new TDMCreateFormLabel('</tbody>'));
- $form->addElement(new TDMCreateFormLabel('<tfoot><tr>'));
- $form_hidden = new XoopsFormHidden('op', 'save');
- $form_button = new XoopsFormButton('', 'submit', _SUBMIT, 'submit');
- $form->addElement(new TDMCreateFormLabel('<td colspan="8">'.$form_hidden->render().'</td>'));
- $form->addElement(new TDMCreateFormLabel('<td>'.$form_button->render().'</td>'));
- $form->addElement(new TDMCreateFormLabel('</tr></tfoot></table>'));
- return $form;
+ // Footer form
+ return $fields_form->getFooterForm($form);
}
/*
@@ -249,34 +259,15 @@
* @param mixed $action
*/
public function getFormEdit($field_mid = null, $field_tid = null, $action = false)
- {
- if ($action === false) {
- $action = $_SERVER['REQUEST_URI'];
- }
-
- $form = new TDMCreateThemeForm(null, 'form', $action, 'post', true);
- $form->setExtra('enctype="multipart/form-data"');
-
- // New Object HtmlTable
- $form->addElement(new TDMCreateFormLabel('<table border="0" cellspacing="1" class="outer width100">'));
- $form->addElement(new TDMCreateFormLabel('<thead class="center">'));
- $form->addElement(new TDMCreateFormLabel('<tr class="head"><th colspan="9">'._AM_TDMCREATE_FIELD_EDIT.'</th></tr>'));
- $form->addElement(new TDMCreateFormLabel('<tr class="head width5">'));
- $form->addElement(new TDMCreateFormLabel('<td>'._AM_TDMCREATE_FIELD_NUMBER.'</td>'));
- $form->addElement(new TDMCreateFormLabel('<td>'._AM_TDMCREATE_FIELD_NAME.'</td>'));
- $form->addElement(new TDMCreateFormLabel('<td>'._AM_TDMCREATE_FIELD_TYPE.'</td>'));
- $form->addElement(new TDMCreateFormLabel('<td>'._AM_TDMCREATE_FIELD_VALUE.'</th>'));
- $form->addElement(new TDMCreateFormLabel('<td>'._AM_TDMCREATE_FIELD_ATTRIBUTE.'</th>'));
- $form->addElement(new TDMCreateFormLabel('<td>'._AM_TDMCREATE_FIELD_NULL.'</th>'));
- $form->addElement(new TDMCreateFormLabel('<td>'._AM_TDMCREATE_FIELD_DEFAULT.'</th>'));
- $form->addElement(new TDMCreateFormLabel('<td>'._AM_TDMCREATE_FIELD_KEY.'</th>'));
- $form->addElement(new TDMCreateFormLabel('<td>'._AM_TDMCREATE_FIELD_PARAMETERS.'</th>'));
- $form->addElement(new TDMCreateFormLabel('</tr></thead>'));
- $form->addElement(new TDMCreateFormLabel('<tbody>'));
+ {
+ // 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);
@@ -284,6 +275,7 @@
foreach($fields as $field) {
$class = ($class == 'even') ? 'odd' : 'even';
$field_id = $field->getVar('field_id');
+ //
$form->addElement(new XoopsFormHidden('field_id['.$field_id.']', $field_id));
$form->addElement(new XoopsFormHidden('field_mid', $field_mid));
$form->addElement(new XoopsFormHidden('field_tid', $field_tid));
@@ -375,10 +367,19 @@
$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++;
}
unset($id);
+ // Footer form
+ return $fields_form->getFooterForm($form);
+ }
+ /*
+ * @private function getFooterForm
+ * @param null
+ */
+ private function getFooterForm($form)
+ {
// Send Form Data
$form->addElement(new TDMCreateFormLabel('</tbody>'));
$form->addElement(new TDMCreateFormLabel('<tfoot><tr>'));
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-01 14:18:13 UTC (rev 12667)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/menu.php 2014-07-02 08:52:43 UTC (rev 12668)
@@ -74,7 +74,7 @@
\$i = 1;
\$adminmenu[\$i]['title'] = {$language}{$menu};
\$adminmenu[\$i]['link'] = 'admin/index.php';
-\$adminmenu[\$i]['icon'] = \$sysPathIcon32.'/home.png';
+\$adminmenu[\$i]['icon'] = \$sysPathIcon32.'/dashboard.png';
\$i++;\n
EOT;
foreach (array_keys($tables) as $i)
@@ -86,7 +86,7 @@
$content .= <<<EOT
\$adminmenu[\$i]['title'] = {$language}{$menu};
\$adminmenu[\$i]['link'] = 'admin/{$tables[$i]->getVar('table_name')}.php';
-\$adminmenu[\$i]['icon'] = \$sysPathIcon32.'/{$tables[$i]->getVar('table_image')}';
+\$adminmenu[\$i]['icon'] = 'assets/images/32/{$tables[$i]->getVar('table_image')}';
\$i++;\n
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-01 14:18:13 UTC (rev 12667)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php 2014-07-02 08:52:43 UTC (rev 12668)
@@ -204,6 +204,7 @@
// Module
$mod_id = $module->getVar('mod_id');
$mod_dirname = $module->getVar('mod_dirname');
+ $uploadTablesIcons32 = $this->upload_path.'/images/tables';
// Id of tables
$criteria_tables = new CriteriaCompo();
$criteria_tables->add(new Criteria('table_mid', $mod_id));
@@ -217,6 +218,7 @@
$table_mid = $tables[$t]->getVar('table_mid');
$table_id = $tables[$t]->getVar('table_id');
$table_name = $tables[$t]->getVar('table_name');
+ $table_image = $tables[$t]->getVar('table_image');
$table_admin = $tables[$t]->getVar('table_admin');
$table_user = $tables[$t]->getVar('table_user');
$table_blocks = $tables[$t]->getVar('table_blocks');
@@ -224,9 +226,12 @@
$table_comments = $tables[$t]->getVar('table_comments');
$table_notifications = $tables[$t]->getVar('table_notifications');
$table_permissions = $tables[$t]->getVar('table_permissions');
-
- $table = $this->tdmcreate->getHandler('tables')->get($table_id);
-
+ // Get Table Object
+ $table = $this->tdmcreate->getHandler('tables')->get($table_id);
+ // Copy of tables images file
+ if( file_exists($upload_table_image = $uploadTablesIcons32.'/'.$table_image)) {
+ $this->structure->copyFile('assets/images/32', $upload_table_image, $table_image);
+ }
// Creation of admin files
if ( $table_admin == 1) {
// Admin Pages File
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-01 14:18:13 UTC (rev 12667)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/classes/classes.php 2014-07-02 08:52:43 UTC (rev 12668)
@@ -60,21 +60,21 @@
$this->setTables($tables);
}
/*
- * @public function getInitVar
+ * @private function getInitVar
* @param string $field_name
* @param string $type
*/
- public function getInitVar($field_name, $type = 'INT') {
+ private function getInitVar($field_name, $type = 'INT') {
$ret = <<<EOT
\$this->initVar('{$field_name}', XOBJ_DTYPE_{$type});\n
EOT;
return $ret;
}
/*
- * @public function getInitVars
+ * @private function getInitVars
* @param array $fields
*/
- public function getInitVars($fields) {
+ private function getInitVars($fields) {
$ret = '';
// Creation of the initVar functions list
foreach (array_keys($fields) as $f)
@@ -126,12 +126,12 @@
return $ret;
}
/*
- * @public function getHeadClass
+ * @private function getHeadClass
* @param string $module_dirname
* @param string $table_name
* @param array $fields
*/
- public function getHeadClass($module_dirname, $table_name, $fields) {
+ private function getHeadClass($module_dirname, $table_name, $fields) {
$ucf_module_dirname = ucfirst($module_dirname);
$ucf_table_name = ucfirst($table_name);
$ret = <<<EOT
@@ -167,11 +167,11 @@
}
/*
- * @public function getHeadFunctionForm
+ * @private function getHeadFunctionForm
* @param string $module
* @param string $table
*/
- public function getHeadFunctionForm($module, $table)
+ private function getHeadFunctionForm($module, $table)
{
$module_dirname = $module->getVar('mod_dirname');
$language = $this->getLanguage($module_dirname, 'AM');
@@ -199,11 +199,11 @@
return $ret;
}
/*
- * @public function getPermissionsInFunctionForm
+ * @private function getPermissionsInFunctionForm
* @param string $module_dirname
* @param string $fpif
*/
- public function getPermissionsInFunctionForm($module_dirname, $fpif) {
+ private function getPermissionsInFunctionForm($module_dirname, $fpif) {
$perm_approve = $this->getLanguage($module_dirname, 'AM', 'PERMISSIONS_APPROVE');
$perm_submit = $this->getLanguage($module_dirname, 'AM', 'PERMISSIONS_SUBMIT');
$perm_view = $this->getLanguage($module_dirname, 'AM', 'PERMISSIONS_VIEW');
@@ -246,7 +246,7 @@
* @public function getFootFunctionForm
* @param null
*/
- public function getFootFunctionForm() {
+ private function getFootFunctionForm() {
$ret = <<<EOT
\$form->addElement(new XoopsFormHidden('op', 'save'));
\$form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
@@ -263,7 +263,7 @@
* @param string $fpif
* @param string $fpmf
*/
- public function getClassHandler($module_dirname, $table_name, $fpif, $fpmf) {
+ private function getClassHandler($module_dirname, $table_name, $fpif, $fpmf) {
$ucf_module_dirname = ucfirst($module_dirname);
$ucf_table_name = ucfirst($table_name);
$ucf_mod_table_handler = $ucf_module_dirname . $ucf_table_name;
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-01 14:18:13 UTC (rev 12667)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/classes/formelements.php 2014-07-02 08:52:43 UTC (rev 12668)
@@ -16,7 +16,7 @@
* @package tdmcreate
* @since 2.5.0
* @author Txmod Xoops http://www.txmodxoops.org
- * @version $Id: form_elements.php 12258 2014-01-02 09:33:29Z timgno $
+ * @version $Id: formelements.php 12258 2014-01-02 09:33:29Z timgno $
*/
defined('XOOPS_ROOT_PATH') or die('Restricted access');
@@ -30,15 +30,6 @@
parent::__construct();
$this->tdmcreate = TDMCreate::getInstance();
}
- /**
- * @param string $method
- * @param array $args
- */
- public function __call($method, $args)
- {
- $arg = isset($args[0]) ? $args[0] : null;
- return $this->getVar($method, $arg);
- }
/*
* @static function &getInstance
* @param null
@@ -61,37 +52,37 @@
$this->setTable($table);
}
/*
- * @public function getXoopsFormText
+ * @private function getXoopsFormText
* @param string $language
* @param string $field_name
* @param string $required
*/
- public function getXoopsFormText($language, $field_name, $required = 'false') {
+ private function getXoopsFormText($language, $field_name, $required = 'false') {
$ret = <<<EOT
\$form->addElement( new XoopsFormText({$language}, '{$field_name}', 50, 255, \$this->getVar('{$field_name}')){$required} );\n
EOT;
return $ret;
}
/*
- * @public function getXoopsFormText
+ * @private function getXoopsFormText
* @param string $language
* @param string $field_name
* @param string $required
*/
- public function getXoopsFormTextArea($language, $field_name, $required = 'false') {
+ private function getXoopsFormTextArea($language, $field_name, $required = 'false') {
$ret = <<<EOT
\$form->addElement( new XoopsFormTextArea({$language}, '{$field_name}', \$this->getVar('{$field_name}'), 4, 47){$required} );\n
EOT;
return $ret;
}
/*
- * @public function getXoopsFormDhtmlTextArea
+ * @private function getXoopsFormDhtmlTextArea
* @param string $language
* @param string $module_dirname
* @param string $field_name
* @param string $required
*/
- public function getXoopsFormDhtmlTextArea($language, $module_dirname, $field_name, $required = 'false') {
+ private function getXoopsFormDhtmlTextArea($language, $module_dirname, $field_name, $required = 'false') {
$ret = <<<EOT
\$editor_configs = array();
\$editor_configs['name'] = '{$field_name}';
@@ -106,12 +97,12 @@
return $ret;
}
/*
- * @public function getXoopsFormCheckBox
+ * @private function getXoopsFormCheckBox
* @param string $language
* @param string $field_name
* @param string $required
*/
- public function getXoopsFormCheckBox($language, $field_name, $required = 'false') {
+ private function getXoopsFormCheckBox($language, $field_name, $required = 'false') {
$ret = <<<EOT
\${$field_name} = \$this->isNew() ? 0 : \$this->getVar('{$field_name}');
\$check_{$field_name} = new XoopsFormCheckBox({$language}, '{$field_name}', \${$field_name});
@@ -121,35 +112,35 @@
return $ret;
}
/*
- * @public function getXoopsFormHidden
+ * @private function getXoopsFormHidden
* @param string $field_name
*/
- public function getXoopsFormHidden($field_name) {
+ private function getXoopsFormHidden($field_name) {
$ret = <<<EOT
\$form->addElement( new XoopsFormHidden('{$field_name}', \$this->getVar('{$field_name}')) );\n
EOT;
return $ret;
}
/*
- * @public function getXoopsFormUploadFile
+ * @private function getXoopsFormUploadFile
* @param string $language
* @param string $field_name
* @param string $required
*/
- public function getXoopsFormUploadFile($language, $module_dirname, $field_name, $required = 'false') {
+ private function getXoopsFormUploadFile($language, $module_dirname, $field_name, $required = 'false') {
$ret = <<<EOT
\$form->addElement( new XoopsFormFile({$language}, '{$field_name}', \$this->{$module_dirname}->getConfig('maxsize')){$required} );\n
EOT;
return $ret;
}
/*
- * @public function getXoopsFormUploadImage
+ * @private function getXoopsFormUploadImage
* @param string $language
* @param string $table_name
* @param string $field_name
* @param string $required
*/
- public function getXoopsFormUploadImage($language, $module_dirname, $table_name, $field_name, $required = 'false') {
+ private function getXoopsFormUploadImage($language, $module_dirname, $table_name, $field_name, $required = 'false') {
$stu_field_name = strtoupper($field_name);
$ret = <<<EOT
//\$form->addElement(new XoopsFormImage({$language}, '{$field_name}', \$this->{$module_dirname}->getConfig('maxsize')){$required});
@@ -187,25 +178,25 @@
return $ret;
}
/*
- * @public function getXoopsFormColorPicker
+ * @private function getXoopsFormColorPicker
* @param string $language
* @param string $field_name
* @param string $required
*/
- public function getXoopsFormColorPicker($language, $module_dirname, $field_name, $required = 'false') {
+ private function getXoopsFormColorPicker($language, $module_dirname, $field_name, $required = 'false') {
$ret = <<<EOT
\$form->addElement( new XoopsFormColorPicker({$language}, '{$field_name}', \$this->{$module_dirname}->getConfig('maxsize')){$required} );\n
EOT;
return $ret;
}
/*
- * @public function getXoopsFormSelect
+ * @private function getXoopsFormSelect
* @param string $language
* @param string $table_name
* @param string $field_name
* @param string $required
*/
- public function getXoopsFormSelect($language, $table_name, $field_name, $required = 'false') {
+ private function getXoopsFormSelect($language, $table_name, $field_name, $required = 'false') {
$ret = <<<EOT
\${$field_name}_select = new XoopsFormSelect({$language}, '{$field_name}', \$this->getVar('{$field_name}'));
\${$field_name}_select->addOptionArray({$table_name}Handler->getList());
@@ -214,24 +205,24 @@
return $ret;
}
/*
- * @public function getXoopsFormSelectUser
+ * @private function getXoopsFormSelectUser
* @param string $language
* @param string $field_name
* @param string $required
*/
- public function getXoopsFormSelectUser($language, $field_name, $required = 'false') {
+ private function getXoopsFormSelectUser($language, $field_name, $required = 'false') {
$ret = <<<EOT
\$form->addElement( new XoopsFormSelectUser({$language}, '{$field_name}', false, \$this->getVar('{$field_name}'), 1, false){$required} );\n
EOT;
return $ret;
}
/*
- * @public function getXoopsFormRadioYN
+ * @private function getXoopsFormRadioYN
* @param string $language
* @param string $field_name
* @param string $required
*/
- public function getXoopsFormRadioYN($language, $field_name, $required = 'false') {
+ private function getXoopsFormRadioYN($language, $field_name, $required = 'false') {
$ret = <<<EOT
${$field_name} = \$this->isNew() ? 0 : \$this->getVar('{$field_name}');
\$form->addElement( new XoopsFormRadioYN({$language}, '{$field_name}', ${$field_name}){$required} );\n
@@ -239,26 +230,26 @@
return $ret;
}
/*
- * @public function getXoopsFormTextDateSelect
+ * @private function getXoopsFormTextDateSelect
* @param string $language
* @param string $field_name
* @param string $required
*/
- public function getXoopsFormTextDateSelect($language, $module_dirname, $field_name, $required = 'false') {
+ private function getXoopsFormTextDateSelect($language, $module_dirname, $field_name, $required = 'false') {
$ret = <<<EOT
\$form->addElement( new XoopsFormTextDateSelect({$language}, '{$field_name}', '', \$this->getVar('{$field_name}')){$required} );\n
EOT;
return $ret;
}
/*
- * @public function getXoopsFormTable
+ * @private function getXoopsFormTable
* @param string $language
* @param string $module_dirname
* @param string $table_name
* @param string $fields
* @param string $required
*/
- public function getXoopsFormTable($language, $module_dirname, $table_name, $fields, $required = 'false')
+ private function getXoopsFormTable($language, $module_dirname, $table_name, $fields, $required = 'false')
{
$field_name = '';
foreach(array_keys($fields) as $f)
@@ -276,14 +267,14 @@
return $ret;
}
/*
- * @public function getXoopsFormTopic
+ * @private function getXoopsFormTopic
* @param string $language
* @param string $module_dirname
* @param string $table_name
* @param string $fields
* @param string $required
*/
- public function getXoopsFormTopic($language, $module_dirname, $table_name, $fields, $required = 'false')
+ private function getXoopsFormTopic($language, $module_dirname, $table_name, $fields, $required = 'false')
{
foreach(array_keys($fields) as $f)
{
@@ -327,58 +318,63 @@
foreach(array_keys($fields) as $f)
{
$field_name = $fields[$f]->getVar('field_name');
- $field_element = $fields[$f]->getVar('field_element');
+ $field_element = $fields[$f]->getVar('field_element');
+ $field_inform = $fields[$f]->getVar('field_inform');
$language = $language_funct . strtoupper($field_name);
$required = ( $fields[$f]->getVar('field_required') == 1 ) ? ', true' : '';
//
- //if($f > 0) { // If we want to hide XoopsFormHidden() or field id
- switch($field_element)
- {
- case 1:
- $ret .= $this->getXoopsFormText($language, $field_name, $required);
- break;
- case 2:
- $ret .= $this->getXoopsFormTextArea($language, $field_name, $required);
- break;
- case 3:
- $ret .= $this->getXoopsFormDhtmlTextArea($language, $module_dirname, $field_name, $required);
- break;
- case 4:
- $ret .= $this->getXoopsFormCheckBox($language, $field_name, $required);
- break;
- case 5:
- $ret .= $this->getXoopsFormRadioYN($language, $field_name, $required);
- break;
- case 6:
- $ret .= $this->getXoopsFormSelect($language, $table_name, $field_name, $required);
- break;
- case 7:
- $ret .= $this->getXoopsFormSelectUser($language, $field_name, $required);
- break;
- case 8:
- $ret .= $this->getXoopsFormColorPicker($language, $module_dirname, $field_name, $required);
- break;
- case 9:
- $ret .= $this->getXoopsFormUploadImage($language_funct, $module_dirname, $table_name, $field_name, $required);
- break;
- case 10:
- $ret .= $this->getXoopsFormUploadFile($language, $module_dirname, $field_name, $required);
- break;
- case 11:
- $ret .= $this->getXoopsFormTextDateSelect($language, $module_dirname, $field_name, $required);
- break;
- default:
- $ret .= $this->getXoopsFormHidden($field_name);
- break;
- }
- if ($field_element > 11) {
- if($table->getVar('table_category') == 1) {
- $ret .= $this->getXoopsFormTopic($language, $module_dirname, $table_name, $fields, $required);
- } else {
- $ret .= $this->getXoopsFormTable($language, $module_dirname, $table_name, $fields, $required);
+ if($field_inform == 1) {
+ // If we want to hide XoopsFormHidden() or field id
+ //if(($f > 0) && ($table->getVar('table_autoincrement') == 1)) {
+ // Switch elements
+ switch($field_element)
+ {
+ case 1:
+ $ret .= $this->getXoopsFormText($language, $field_name, $required);
+ break;
+ case 2:
+ $ret .= $this->getXoopsFormTextArea($language, $field_name, $required);
+ break;
+ case 3:
+ $ret .= $this->getXoopsFormDhtmlTextArea($language, $module_dirname, $field_name, $required);
+ break;
+ case 4:
+ $ret .= $this->getXoopsFormCheckBox($language, $field_name, $required);
+ break;
+ case 5:
+ $ret .= $this->getXoopsFormRadioYN($language, $field_name, $required);
+ break;
+ case 6:
+ $ret .= $this->getXoopsFormSelect($language, $table_name, $field_name, $required);
+ break;
+ case 7:
+ $ret .= $this->getXoopsFormSelectUser($language, $field_name, $required);
+ break;
+ case 8:
+ $ret .= $this->getXoopsFormColorPicker($language, $module_dirname, $field_name, $required);
+ break;
+ case 9:
+ $ret .= $this->getXoopsFormUploadImage($language_funct, $module_dirname, $table_name, $field_name, $required);
+ break;
+ case 10:
+ $ret .= $this->getXoopsFormUploadFile($language, $module_dirname, $field_name, $required);
+ break;
+ case 11:
+ $ret .= $this->getXoopsFormTextDateSelect($language, $module_dirname, $field_name, $required);
+ break;
+ default:
+ $ret .= $this->getXoopsFormHidden($field_name);
+ break;
}
- }
- //}
+ if ($field_element > 11) {
+ if($table->getVar('table_category') == 1) {
+ $ret .= $this->getXoopsFormTopic($language, $module_dirname, $table_name, $fields, $required);
+ } else {
+ $ret .= $this->getXoopsFormTable($language, $module_dirname, $table_name, $fields, $required);
+ }
+ }
+ //}
+ }
}
return $ret;
}
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-01 14:18:13 UTC (rev 12667)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/xoopsversion.php 2014-07-02 08:52:43 UTC (rev 12668)
@@ -93,7 +93,7 @@
*/
private function getXoopsVersionHeader($module, $table, $language)
{
- $date = date('D Y/m/d G:i:s');
+ $date = date('Y/m/d');
$ret = <<<EOT
defined('XOOPS_ROOT_PATH') or die('Restricted access');
//
@@ -141,7 +141,8 @@
'release' => "{$module->getVar('mod_release')}",
'module_status' => "{$module->getVar('mod_status')}",\n
EOT;
- if ( $table->getVar('table_admin') == 1 ) {
+ if (is_object($table)) {
+ if ( $table->getVar('table_admin') == 1 ) {
$ret .= <<<EOT
// Admin system menu
'system_menu' => 1,
@@ -150,6 +151,7 @@
'adminindex' => "admin/index.php",
'adminmenu' => "admin/menu.php",\n
EOT;
+ }
} else {
$ret .= <<<EOT
// Admin system menu
@@ -158,12 +160,13 @@
'hasAdmin' => 0,\n
EOT;
}
- if ( $table->getVar('table_user') == 1 )
- {
+ if (is_object($table)) {
+ if ( $table->getVar('table_user') == 1 ) {
$ret .= <<<EOT
// Menu
'hasMain' => 1,\n
EOT;
+ }
} else {
$ret .= <<<EOT
// Menu
@@ -636,9 +639,9 @@
$filename = $this->getFileName();
$module_dirname = $module->getVar('mod_dirname');
$language = $this->getLanguage($module_dirname, 'MI');
- $content = $this->getHeaderFilesComments($module, $filename);
- if (is_object($table)) {
- $content .= $this->getXoopsVersionHeader($module, $table, $language);
+ $content = $this->getHeaderFilesComments($module, $filename);
+ $content .= $this->getXoopsVersionHeader($module, $table, $language);
+ if (is_object($table)) {
$content .= $this->getXoopsVersionMySQL($module_dirname, $table);
if ($table->getVar('table_search') == 1) {
$content .= $this->getXoopsVersionSearch($module_dirname);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/logoGenerator.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/logoGenerator.php 2014-07-01 14:18:13 UTC (rev 12667)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/logoGenerator.php 2014-07-02 08:52:43 UTC (rev 12668)
@@ -36,7 +36,7 @@
class logoGenerator
{
- static function createLogo($logoIcon, $moduleName)
+ static function createLogo($logoIcon, $moduleDirname)
{
if (!extension_loaded("gd")) {
return false;
@@ -65,13 +65,13 @@
// Write text
$text_color = imagecolorallocate($imageModule, 0, 0, 0);
- $space_to_border = (92 - strlen($moduleName) * 7.5) / 2;
- imagefttext($imageModule, 8.5, 0, $space_to_border, 45, $text_color, $font, ucfirst($moduleName), array());
+ $space_to_border = (92 - strlen($moduleDirname) * 7.5) / 2;
+ imagefttext($imageModule, 8.5, 0, $space_to_border, 45, $text_color, $font, ucfirst($moduleDirname), array());
imagecopy($imageModule, $imageIcon, 29, 2, 0, 0, 32, 32);
- //$targetImage = TDMC_UPLOAD_IMGMOD_URL . "/" . $moduleName . "_logo.png";
- $targetImage = "/uploads/" . $dirname . "/images/repository/" . $moduleName . "_logo.png";
+ //$targetImage = TDMC_UPLOAD_IMGMOD_URL . "/" . $moduleDirname . "_slogo.png";
+ $targetImage = "/uploads/" . $dirname . "/images/repository/" . $moduleDirname . "_slogo.png";
imagepng($imageModule, XOOPS_ROOT_PATH . $targetImage );
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/modules.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/modules.php 2014-07-01 14:18:13 UTC (rev 12667)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/modules.php 2014-07-02 08:52:43 UTC (rev 12668)
@@ -118,7 +118,7 @@
$action = $_SERVER['REQUEST_URI'];
}
$isNew = $this->isNew();
- $title = $isNew ? sprintf(_AM_TDMCREATE_MODULE_ADD) : sprintf(_AM_TDMCREATE_MODULE_EDIT);
+ $title = $isNew ? sprintf(_AM_TDMCREATE_MODULE_NEW) : sprintf(_AM_TDMCREATE_MODULE_EDIT);
include_once(XOOPS_ROOT_PATH."/class/xoopsformloader.php");
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tables.php 2014-07-01 14:18:13 UTC (rev 12667)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tables.php 2014-07-02 08:52:43 UTC (rev 12668)
@@ -98,7 +98,7 @@
$isNew = $this->isNew();
$table_name = $this->getVar('table_name');
$table_mid = $this->getVar('table_mid');
- $title = $isNew ? sprintf(_AM_TDMCREATE_TABLE_ADD) : sprintf(_AM_TDMCREATE_TABLE_EDIT);
+ $title = $isNew ? sprintf(_AM_TDMCREATE_TABLE_NEW) : sprintf(_AM_TDMCREATE_TABLE_EDIT);
xoops_load('xoopsformloader');
$form = new XoopsThemeForm($title, 'tableform', $action, 'post', true);
@@ -140,12 +140,13 @@
$get_table_image = $this->getVar('table_image');
$table_image = $get_table_image ? $get_table_image : 'blank.gif';
$iconsdir = '/Frameworks/moduleclasses/icons/32';
- $uploads_dir = '/uploads/'.$GLOBALS['xoopsModule']->dirname().'/images/tables';
+ $uploads_dir = '/uploads/tdmcreate/images/tables';
if(is_dir(XOOPS_ROOT_PATH . $iconsdir)){
$iconsdirectory = $iconsdir;
}else{
$iconsdirectory = $uploads_dir;
}
+ /*$iconsdirectory = $isNew ? $iconsdir : $uploads_dir;*/
//
$imgtray1 = new XoopsFormElementTray(_AM_TDMCREATE_TABLE_IMAGE,'<br />');
if(is_dir(XOOPS_ROOT_PATH . $iconsdir)) {
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-01 14:18:13 UTC (rev 12667)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/admin.php 2014-07-02 08:52:43 UTC (rev 12668)
@@ -68,7 +68,7 @@
//Buttons
define('_AM_TDMCREATE_ADD_MODULE', "Add new module");
//Form
-define('_AM_TDMCREATE_MODULE_ADD', "Add a new module");
+define('_AM_TDMCREATE_MODULE_NEW', "New module");
define('_AM_TDMCREATE_MODULE_EDIT', "Edit module");
//define('_AM_TDMCREATE_MODULE_IMPORTANT', "Required Information");
@@ -131,7 +131,7 @@
// Buttons
define('_AM_TDMCREATE_ADD_TABLE', "Add new table");
//Form1
-define('_AM_TDMCREATE_TABLE_ADD', "Add Table");
+define('_AM_TDMCREATE_TABLE_NEW', "New Table");
define('_AM_TDMCREATE_TABLE_EDIT', "Edit Table");
define('_AM_TDMCREATE_TABLE_MODULES', "Choose a module");
define('_AM_TDMCREATE_TABLE_NAME', "Table Name");
@@ -166,10 +166,12 @@
define('_AM_TDMCREATE_TABLE_FORM_SAVED_OK', "The table <b class='green'>%s</b> is successfully saved");
define('_AM_TDMCREATE_TABLE_FORM_UPDATED_OK', "The table <b class='green'>%s</b> is successfully updated");
-//Form2
-define('_AM_TDMCREATE_FIELD_ADD', "Add fields");
-define('_AM_TDMCREATE_FIELD_EDIT', "Edit fields");
-define('_AM_TDMCREATE_FIELD_NUMBER', "N°");
+// ------------------ Form Fields ------------------
+// Caption
+define('_AM_TDMCREATE_FIELDS_NEW', "New fields");
+define('_AM_TDMCREATE_FIELDS_EDIT', "Edit fields");
+// Fields
+define('_AM_TDMCREATE_FIELD_ID', "N°");
define('_AM_TDMCREATE_FIELD_NAME', "Field Name");
define('_AM_TDMCREATE_FIELD_TYPE', "Type");
define('_AM_TDMCREATE_FIELD_VALUE', "Value");
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_fields.tpl
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_fields.tpl 2014-07-01 14:18:13 UTC (rev 12667)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_fields.tpl 2014-07-02 08:52:43 UTC (rev 12668)
@@ -46,8 +46,8 @@
<td class='xo-actions txtcenter width6'>
<a href="tables.php?op=edit&table_id=<{$table.id}>" title="<{$smarty.const._AM_TDMCREATE_EDIT_TABLE}>">
<img src="<{xoModuleIcons16 edit.png}>" alt="<{$smarty.const._AM_TDMCREATE_EDIT_TABLE}>" />
- </a> <!-- &field_mid=<{$table.mid}>&field_tid=<{$table.id}>&field_numb=<{$table.nbfields}> -->
- <a href="fields.php?op=edit&field_tid=<{$table.id}>" title="<{$smarty.const._AM_TDMCREATE_EDIT_FIELDS}>">
+ </a>
+ <a href="fields.php?op=edit&field_mid=<{$table.mid}>&field_tid=<{$table.id}>" title="<{$smarty.const._AM_TDMCREATE_EDIT_FIELDS}>">
<img src="<{xoModuleIcons16 inserttable.png}>" alt="<{$smarty.const._AM_TDMCREATE_EDIT_FIELDS}>" />
</a>
<a href="tables.php?op=delete&table_id=<{$table.id}>" title="<{$smarty.const._DELETE}>">
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-01 14:18:13 UTC (rev 12667)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_tables.tpl 2014-07-02 08:52:43 UTC (rev 12668)
@@ -54,7 +54,7 @@
<a href="modules.php?op=delete&mod_id=<{$module.id}>" title="<{$smarty.const._DELETE}>">
<img src="<{xoModuleIcons16 delete.png}>" alt="<{$smarty.const._DELETE}>" alt="<{$smarty.const._DELETE}>" />
</a>
- </td>
+ </td>
</tr>
<{foreach item=table from=$module.tables}>
<tr id="table<{$table.id}>" class="<{cycle values='even,odd'}> toggleChild">
@@ -79,7 +79,7 @@
<td class='center'><img id="loading_img_table_permissions<{$table.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_table_permissions<{$table.id}>" onclick="tdmcreate_setStatus( { op: 'display', table_id: <{$table.id}>, table_permissions: <{if $table.permissions}>0<{else}>1<{/if}> }, 'img_table_permissions<{$table.id}>', 'tables.php' )" src="<{xoModuleIcons16}><{$table.permissions}>.png" alt="<{$smarty.const._AM_TDMCREATE_CHANGE_DISPLAY}> <{$table.name}>" title="<{$smarty.const._AM_TDMCREATE_CHANGE_DISPLAY}> <{$table.name}>" />
</td>
<td class='xo-actions txtcenter width6'>
- <a href="tables.php?op=edit&table_id=<{$table.id}>" title="<{$smarty.const._EDIT}>">
+ <a href="tables.php?op=edit&table_mid=<{$table.mid}>&table_id=<{$table.id}>" title="<{$smarty.const._EDIT}>">
<img src="<{xoModuleIcons16 edit.png}>" alt="<{$smarty.const._EDIT}>" />
</a>
<a href="fields.php?op=edit&field_tid=<{$table.id}>" title="<{$smarty.const._EDIT}>">
|