From: <txm...@us...> - 2015-06-03 09:42:13
|
Revision: 13077 http://sourceforge.net/p/xoops/svn/13077 Author: txmodxoops Date: 2015-06-03 09:42:10 +0000 (Wed, 03 Jun 2015) Log Message: ----------- Addeds & fix Modified Paths: -------------- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/fields.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateArchitecture.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/admin/AdminObjects.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/classes/ClassFiles.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/classes/ClassFormElements.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/include/IncludeCommon.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/modules.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/settings.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/tables.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/language/english/admin.php Added Paths: ----------- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/autoload.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/autoload.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/form/TDMCreateFormRaw.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/form/TDMCreateFormTab.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/form/TDMCreateFormTabTray.php Removed Paths: ------------- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/TDMCreateAutoload.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateAutoload.php Deleted: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/TDMCreateAutoload.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/TDMCreateAutoload.php 2015-06-02 13:47:44 UTC (rev 13076) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/TDMCreateAutoload.php 2015-06-03 09:42:10 UTC (rev 13077) @@ -1,57 +0,0 @@ -<?php -/* - You may not change or alter any portion of this comment or credits - of supporting developers from this source code or any supporting source code - which is considered copyrighted (c) material of the original comment or credit authors. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - */ -/** - * tdmcreate module - * - * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ - * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) - * @package tdmcreate - * @since 2.5.0 - * @author Txmod Xoops http://www.txmodxoops.org - * @version $Id: TDMCreateAutoload.php 12258 2014-01-02 09:33:29Z timgno $ - */ -defined('XOOPS_ROOT_PATH') or die('Restricted access'); - -/** - * @since 1.91 - */ -// Autoload Function -ini_set('display_errors',1); -error_reporting(E_ALL|E_STRICT); - -function application_autoloader($class) { - $classFilename = $class.'.php'; - $cacheFile = __DIR__ . '/cache/classpaths.cache'; - $pathCache = (file_exists($cacheFile)) ? unserialize(file_get_contents($cacheFile)) : array(); - if (!is_array($pathCache)) { $pathCache = array(); } - - if (array_key_exists($class, $pathCache)) { - /* Load class using path from cache file (if the file still exists) */ - if (file_exists($pathCache[$class])) { require_once $pathCache[$class]; } - - } else { - /* Determine the location of the file within the $class_root and, if found, load and cache it */ - $directories = new RecursiveDirectoryIterator(__DIR__); - foreach(new RecursiveIteratorIterator($directories) as $file) { - if ($file->getFilename() == $classFilename) { - $fullPath = $file->getRealPath(); - $pathCache[$class] = $fullPath; - require_once $fullPath; - break; - } - } - } - - $serialized_paths = serialize($pathCache); - if ($serialized_paths != $pathCache) { file_put_contents($cacheFile, serialize($pathCache)); } -} - -spl_autoload_register('application_autoloader'); \ No newline at end of file Added: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/autoload.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/autoload.php (rev 0) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/autoload.php 2015-06-03 09:42:10 UTC (rev 13077) @@ -0,0 +1,56 @@ +<?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +/** + * tdmcreate module + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package tdmcreate + * @since 2.5.0 + * @author Txmod Xoops http://www.txmodxoops.org + * @version $Id: TDMCreateAutoload.php 12258 2014-01-02 09:33:29Z timgno $ + */ +defined('XOOPS_ROOT_PATH') or die('Restricted access'); +/** + * @since 1.91 + */ +// Autoload Function +ini_set('display_errors',1); +error_reporting(E_ALL|E_STRICT); + +function applicationAutoloader($class) { + $classFilename = $class.'.php'; + $cacheFile = __DIR__ . '/cache/classpaths.cache'; + $pathCache = (file_exists($cacheFile)) ? unserialize(file_get_contents($cacheFile)) : array(); + if (!is_array($pathCache)) { $pathCache = array(); } + + if (array_key_exists($class, $pathCache)) { + /* Load class using path from cache file (if the file still exists) */ + if (file_exists($pathCache[$class])) { require_once $pathCache[$class]; } + + } else { + /* Determine the location of the file within the $class_root and, if found, load and cache it */ + $directories = new RecursiveDirectoryIterator(__DIR__); + foreach(new RecursiveIteratorIterator($directories) as $file) { + if ($file->getFilename() == $classFilename) { + $fullPath = $file->getRealPath(); + $pathCache[$class] = $fullPath; + require_once $fullPath; + break; + } + } + } + + $serialized_paths = serialize($pathCache); + if ($serialized_paths != $pathCache) { file_put_contents($cacheFile, serialize($pathCache)); } +} + +spl_autoload_register('applicationAutoloader'); \ No newline at end of file Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/fields.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/fields.php 2015-06-02 13:47:44 UTC (rev 13076) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/fields.php 2015-06-03 09:42:10 UTC (rev 13077) @@ -20,7 +20,7 @@ */ defined('XOOPS_ROOT_PATH') or die('Restricted access'); // Autoloader Classes -include __DIR__ . '/TDMCreateAutoload.php'; +include __DIR__ . '/autoload.php'; /* * @Class TDMCreateFields * @extends XoopsObject Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateArchitecture.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateArchitecture.php 2015-06-02 13:47:44 UTC (rev 13076) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateArchitecture.php 2015-06-03 09:42:10 UTC (rev 13077) @@ -19,9 +19,7 @@ * @version $Id: TDMCreateArchitecture.php 12258 2014-01-02 09:33:29Z timgno $ */ defined('XOOPS_ROOT_PATH') or die('Restricted access'); -// Autoloader Classes -include __DIR__ . '/TDMCreateAutoload.php'; - +include __DIR__ . '/autoload.php'; /** * Class TDMCreateArchitecture */ Deleted: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateAutoload.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateAutoload.php 2015-06-02 13:47:44 UTC (rev 13076) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateAutoload.php 2015-06-03 09:42:10 UTC (rev 13077) @@ -1,57 +0,0 @@ -<?php -/* - You may not change or alter any portion of this comment or credits - of supporting developers from this source code or any supporting source code - which is considered copyrighted (c) material of the original comment or credit authors. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - */ -/** - * tdmcreate module - * - * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ - * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) - * @package tdmcreate - * @since 2.5.0 - * @author Txmod Xoops http://www.txmodxoops.org - * @version $Id: TDMCreateAutoload.php 12258 2014-01-02 09:33:29Z timgno $ - */ -defined('XOOPS_ROOT_PATH') or die('Restricted access'); - -/** - * @since 1.91 - */ -// Autoload Function -ini_set('display_errors',1); -error_reporting(E_ALL|E_STRICT); - -function applicationAutoloader($class) { - $classFilename = $class.'.php'; - $cacheFile = __DIR__ . '/cache/classpaths.cache'; - $pathCache = (file_exists($cacheFile)) ? unserialize(file_get_contents($cacheFile)) : array(); - if (!is_array($pathCache)) { $pathCache = array(); } - - if (array_key_exists($class, $pathCache)) { - /* Load class using path from cache file (if the file still exists) */ - if (file_exists($pathCache[$class])) { require_once $pathCache[$class]; } - - } else { - /* Determine the location of the file within the $class_root and, if found, load and cache it */ - $directories = new RecursiveDirectoryIterator(__DIR__); - foreach(new RecursiveIteratorIterator($directories) as $file) { - if ($file->getFilename() == $classFilename) { - $fullPath = $file->getRealPath(); - $pathCache[$class] = $fullPath; - require_once $fullPath; - break; - } - } - } - - $serializedPaths = serialize($pathCache); - if ($serializedPaths != $pathCache) { file_put_contents($cacheFile, serialize($pathCache)); } -} - -spl_autoload_register('applicationAutoloader'); \ No newline at end of file Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/admin/AdminObjects.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/admin/AdminObjects.php 2015-06-02 13:47:44 UTC (rev 13076) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/admin/AdminObjects.php 2015-06-03 09:42:10 UTC (rev 13077) @@ -101,8 +101,7 @@ \${$tableName}Obj->setVar('{$fieldName}', formatUrl(\$_REQUEST['{$fieldName}']));\n // Set Var {$fieldName} include_once XOOPS_ROOT_PATH.'/class/uploader.php'; - \$uploaddir = {$stuModuleDirname}_UPLOAD_PATH.'/files/{$tableName}'; - \$uploader = new XoopsMediaUploader(\$uploaddir, \${$moduleDirname}->getConfig('mimetypes'), + \$uploader = new XoopsMediaUploader({$stuModuleDirname}_UPLOAD_FILES_PATH . '/{$tableName}', \${$moduleDirname}->getConfig('mimetypes'), \${$moduleDirname}->getConfig('maxsize'), null, null); if (\$uploader->fetchMedia(\$_POST['xoops_upload_file'][0])) { \$uploader->fetchMedia(\$_POST['xoops_upload_file'][0]); Added: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/autoload.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/autoload.php (rev 0) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/autoload.php 2015-06-03 09:42:10 UTC (rev 13077) @@ -0,0 +1,56 @@ +<?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +/** + * tdmcreate module + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package tdmcreate + * @since 2.5.0 + * @author Txmod Xoops http://www.txmodxoops.org + * @version $Id: TDMCreateAutoload.php 12258 2014-01-02 09:33:29Z timgno $ + */ +defined('XOOPS_ROOT_PATH') or die('Restricted access'); +/** + * @since 1.91 + */ +// Autoload Function +ini_set('display_errors',1); +error_reporting(E_ALL|E_STRICT); + +function applicationAutoloader1($class) { + $classFilename = $class.'.php'; + $cacheFile = __DIR__ . '/cache/classpaths.cache'; + $pathCache = (file_exists($cacheFile)) ? unserialize(file_get_contents($cacheFile)) : array(); + if (!is_array($pathCache)) { $pathCache = array(); } + + if (array_key_exists($class, $pathCache)) { + /* Load class using path from cache file (if the file still exists) */ + if (file_exists($pathCache[$class])) { require_once $pathCache[$class]; } + + } else { + /* Determine the location of the file within the $class_root and, if found, load and cache it */ + $directories = new RecursiveDirectoryIterator(__DIR__); + foreach(new RecursiveIteratorIterator($directories) as $file) { + if ($file->getFilename() == $classFilename) { + $fullPath = $file->getRealPath(); + $pathCache[$class] = $fullPath; + require_once $fullPath; + break; + } + } + } + + $serialized_paths = serialize($pathCache); + if ($serialized_paths != $pathCache) { file_put_contents($cacheFile, serialize($pathCache)); } +} + +spl_autoload_register('applicationAutoloader1'); \ No newline at end of file Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/classes/ClassFiles.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/classes/ClassFiles.php 2015-06-02 13:47:44 UTC (rev 13076) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/classes/ClassFiles.php 2015-06-03 09:42:10 UTC (rev 13077) @@ -361,7 +361,7 @@ /** * @return string */ - private function getValuesInForm($fields) + private function getValuesInForm($moduleDirname, $table, $fields) { $ret = <<<EOT /** @@ -393,9 +393,28 @@ EOT; break; default: - $ret .= <<<EOT + if ($fieldElement > 15) { + $fieldElements = $this->tdmcreate->getHandler('fieldelements')->get($fieldElement); + $fieldElementMid = $fieldElements->getVar('fieldelement_mid'); + $fieldElementTid = $fieldElements->getVar('fieldelement_tid'); + $fieldElementName = $fieldElements->getVar('fieldelement_name'); + $fieldNameDesc = substr($fieldElementName, strrpos($fieldElementName, ':'), strlen($fieldElementName)); + $topicTableName = str_replace(': ', '', strtolower($fieldNameDesc)); + $fieldsTopics = $this->getTableFields($fieldElementMid, $fieldElementTid); + foreach (array_keys($fieldsTopics) as $f) { + $fieldNameTopic = $fieldsTopics[$f]->getVar('field_name'); + if (1 == $fieldsTopics[$f]->getVar('field_main')) { + $fieldMainTopic = $fieldNameTopic; + } + } + $ret .= <<<EOT + \$ret['{$rpFieldName}'] = \$this->{$moduleDirname}->getHandler('{$topicTableName}')->get(\$this->getVar('{$fieldName}'))->getVar('{$fieldMainTopic}');\n +EOT; + } else { + $ret .= <<<EOT \$ret['{$rpFieldName}'] = \$this->getVar('{$fieldName}');\n EOT; + } break; } } @@ -835,7 +854,7 @@ } $content .= $this->getFootInForm(); } - $content .= $this->getValuesInForm($fields); + $content .= $this->getValuesInForm($moduleDirname, $table, $fields); $content .= $this->getToArrayInForm(); if(in_array(5, $fieldElementId)) { $content .= $this->getOptionsCheck($table); Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/classes/ClassFormElements.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/classes/ClassFormElements.php 2015-06-02 13:47:44 UTC (rev 13076) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/classes/ClassFormElements.php 2015-06-03 09:42:10 UTC (rev 13077) @@ -169,12 +169,14 @@ */ private function getXoopsFormCheckBox($language, $fieldName, $required = 'false') { - $ret = <<<EOT + $ucfFieldName = $this->tdmcfile->getCamelCase($fieldName, true); + $ccFieldName = $this->tdmcfile->getCamelCase($fieldName, false, true); + $ret = <<<EOT // Form Check Box - \${$fieldName} = \$this->isNew() ? 0 : \$this->getVar('{$fieldName}'); - \$check_{$fieldName} = new XoopsFormCheckBox({$language}, '{$fieldName}', \${$fieldName}); - \$check_{$fieldName}->addOption(1, " "); - \$form->addElement( \$check_{$fieldName}{$required} );\n + \${$ccFieldName} = \$this->isNew() ? 0 : \$this->getVar('{$fieldName}'); + \$check{$ucfFieldName} = new XoopsFormCheckBox({$language}, '{$fieldName}', \${$ccFieldName}); + \$check{$ucfFieldName}->addOption(1, " "); + \$form->addElement( \$check{$ucfFieldName}{$required} );\n EOT; return $ret; @@ -221,16 +223,16 @@ $stuFieldName = strtoupper($fieldName); $rpFieldName = $this->tdmcfile->getRightString($fieldName); $stuSoleName = strtoupper($tableSoleName .'_'. $rpFieldName); - $ucfFieldName = $this->tdmcfile->getCamelCase($fieldName, true, false); + $ucfFieldName = $this->tdmcfile->getCamelCase($fieldName, true); $ccFieldName = $this->tdmcfile->getCamelCase($fieldName, false, true); $ret = <<<EOT // Form Frameworks Image Files \$get{$ucfFieldName} = \$this->getVar('{$fieldName}'); \${$ccFieldName} = \$get{$ucfFieldName} ? \$get{$ucfFieldName} : 'blank.gif'; - \$imageDirectory = XOOPS_ROOT_PATH . '/Frameworks/moduleclasses/icons/32'; + \$imageDirectory = '/Frameworks/moduleclasses/icons/32'; \$imageTray = new XoopsFormElementTray({$language}{$stuSoleName},'<br />'); - \$imageSelect = new XoopsFormSelect(\$imageDirectory, '{$fieldName}', \${$ccFieldName}, 5); - \$imageArray = XoopsLists::getImgListAsArray( \$imageDirectory ); + \$imageSelect = new XoopsFormSelect(sprintf({$language}FORM_IMAGE_PATH, ".{\$imageDirectory}/"), '{$fieldName}', \${$ccFieldName}, 5); + \$imageArray = XoopsLists::getImgListAsArray( XOOPS_ROOT_PATH . \$imageDirectory ); foreach( \$imageArray as \$image1 ) { \$imageSelect->addOption("{\$image1}", \$image1); } @@ -267,7 +269,7 @@ */ private function getXoopsFormSelectFile($language, $moduleDirname, $fieldName, $fieldElement, $required = 'false') { - $ucfFieldName = $this->tdmcfile->getCamelCase($fieldName, true, false); + $ucfFieldName = $this->tdmcfile->getCamelCase($fieldName, true); $ccFieldName = $this->tdmcfile->getCamelCase($fieldName, false, true); $ret = <<<EOT // Image Select or Upload @@ -276,22 +278,21 @@ \$uploadDirectory = '/uploads/{$moduleDirname}/images/shots'; \${$moduleDirname}ShotImage = \${$fieldName} ? \${$fieldName} : 'blank.gif'; // - \$imgtray = new XoopsFormElementTray({$language}FORM_IMAGE,'<br />'); - \$imagePath = sprintf({$language}_FORM_PATH, \$uploadDirectory ); - \$imageselect = new XoopsFormSelect(\$imagePath, 'selected_image',\${$moduleDirname}ShotImage); + \$imageTray = new XoopsFormElementTray({$language}FORM_IMAGE,'<br />'); + \$imageSelect = new XoopsFormSelect(sprintf({$language}_FORM_PATH, \$uploadDirectory ), 'selected_image',\${$moduleDirname}ShotImage); \$imageArray = XoopsLists :: getImgListAsArray( XOOPS_ROOT_PATH . \$uploadDirectory ); foreach( \$imageArray as \$image ) { - \$imageselect->addOption("{\$image}", \$image); + \$imageSelect->addOption("{\$image}", \$image); } - \$imageselect->setExtra( "onchange='showImgSelected(\"image3\", \"selected_image\", \"" . \$uploadDirectory . "\", \"\", \"" . XOOPS_URL . "\")'" ); - \$imgtray->addElement(\$imageselect,false); - \$imgtray -> addElement( new XoopsFormLabel( '', "<br /><img src='" . XOOPS_URL . "/" . \$uploadDirectory . "/" . \${$moduleDirname}ShotImage . "' name='image3' id='image3' alt='' />" ) ); + \$imageSelect->setExtra( "onchange='showImgSelected(\"image3\", \"selected_image\", \"" . \$uploadDirectory . "\", \"\", \"" . XOOPS_URL . "\")'" ); + \$imageTray->addElement(\$imageSelect,false); + \$imageTray -> addElement( new XoopsFormLabel( '', "<br /><img src='" . XOOPS_URL . "/" . \$uploadDirectory . "/" . \${$moduleDirname}ShotImage . "' name='image3' id='image3' alt='' />" ) ); \$fileSelectTray= new XoopsFormElementTray('','<br />'); //if (\$permissionUpload == true) { \$fileSelectTray->addElement(new XoopsFormFile({$language}_FORMUPLOAD , 'attachedimage', \$this->{$moduleDirname}->getConfig('maxuploadsize')){$required}); //} - \$imgtray->addElement(\$fileSelectTray); - \$form->addElement(\$imgtray); + \$imageTray->addElement(\$fileSelectTray); + \$form->addElement(\$imageTray); }\n EOT; @@ -321,9 +322,9 @@ $ret = <<<EOT // Form Url Text File \$formUrlFile = new XoopsFormElementTray({$language}FORM_FILE,'<br /><br />'); - \$formFile = \$this->isNew() ? '{$fieldDefault}' : \$this->getVar('{$fieldName}'); - \$formFormText = new XoopsFormText({$language}FORM_TEXT, '{$fieldName}', 75, 255, \$formFile); - \$formUrlFile->addElement(\$formFormText{$required} ); + \$formUrl = \$this->isNew() ? '{$fieldDefault}' : \$this->getVar('{$fieldName}'); + \$formText = new XoopsFormText({$language}FORM_TEXT, '{$fieldName}', 75, 255, \$formUrl); + \$formUrlFile->addElement(\$formText{$required} ); \$formUrlFile->addElement(new XoopsFormFile({$language}FORM_UPLOAD , 'attachedfile', \$this->{$moduleDirname}->getConfig('maxsize')){$required}); \$form->addElement(\$formUrlFile);\n EOT; @@ -350,17 +351,16 @@ $stuModuleDirname = strtoupper($moduleDirname); $stuTableName = strtoupper($tableName); $stuSoleName = strtoupper($tableSoleName); - $ucfFieldName = $this->tdmcfile->getCamelCase($fieldName, true, false); + $ucfFieldName = $this->tdmcfile->getCamelCase($fieldName, true); $ccFieldName = $this->tdmcfile->getCamelCase($fieldName, false, true); $ret = <<<EOT // Form Upload Image \$get{$ucfFieldName} = \$this->getVar('{$fieldName}'); \${$ccFieldName} = \$get{$ucfFieldName} ? \$get{$ucfFieldName} : 'blank.gif'; - \$imageDirectory = {$stuModuleDirname}_UPLOAD_PATH . '/images/{$tableName}'; + \$imageDirectory = '/uploads/{$moduleDirname}/images/{$tableName}'; // \$imageTray = new XoopsFormElementTray({$language}{$stuSoleName}_IMAGE,'<br />'); - \$imagePath = sprintf({$language}FORM_IMAGE_PATH, ".{\$imageDirectory}/"); - \$imageSelect = new XoopsFormSelect(\$imagePath, '{$fieldName}', \${$ccFieldName}, 5); + \$imageSelect = new XoopsFormSelect(sprintf({$language}FORM_IMAGE_PATH, ".{\$imageDirectory}/"), '{$fieldName}', \${$ccFieldName}, 5); \$imageArray = XoopsLists::getImgListAsArray( XOOPS_ROOT_PATH . \$imageDirectory ); foreach( \$imageArray as \$image ) { \$imageSelect->addOption("{\$image}", \$image); @@ -445,12 +445,13 @@ */ private function getXoopsFormSelectBox($language, $tableName, $fieldName, $required = 'false') { - $ret = <<<EOT + $ccFieldName = $this->tdmcfile->getCamelCase($fieldName, false, true); + $ret = <<<EOT // Form Select - \${$fieldName}_select = new XoopsFormSelect({$language}, '{$fieldName}', \$this->getVar('{$fieldName}')); - \${$fieldName}_select->addOption('Empty'); - \${$fieldName}_select->addOptionArray(\${$tableName}Handler->getList()); - \$form->addElement( \${$fieldName}_select{$required} );\n + \${$ccFieldName}Select = new XoopsFormSelect({$language}, '{$fieldName}', \$this->getVar('{$fieldName}')); + \${$ccFieldName}Select->addOption('Empty'); + \${$ccFieldName}Select->addOptionArray(\${$tableName}Handler->getList()); + \$form->addElement( \${$ccFieldName}Select{$required} );\n EOT; return $ret; @@ -492,10 +493,11 @@ */ private function getXoopsFormRadioYN($language, $fieldName, $required = 'false') { - $ret = <<<EOT + $ccFieldName = $this->tdmcfile->getCamelCase($fieldName, false, true); + $ret = <<<EOT // Form Radio Yes/No - \${$fieldName} = \$this->isNew() ? 0 : \$this->getVar('{$fieldName}'); - \$form->addElement( new XoopsFormRadioYN({$language}, '{$fieldName}', \${$fieldName}){$required} );\n + \${$ccFieldName} = \$this->isNew() ? 0 : \$this->getVar('{$fieldName}'); + \$form->addElement( new XoopsFormRadioYN({$language}, '{$fieldName}', \${$ccFieldName}){$required} );\n EOT; return $ret; @@ -548,12 +550,13 @@ $fElement = $this->tdmcreate->getHandler('fieldelements')->get($fieldElement); $rpFieldelementName = strtolower(str_replace('Table : ', '', $fElement->getVar('fieldelement_name'))); } - $ret = <<<EOT + $ccFieldName = $this->tdmcfile->getCamelCase($fieldName, false, true); + $ret = <<<EOT // Form Table {$ucfTableName} \${$rpFieldelementName}Handler =& \$this->{$moduleDirname}->getHandler('{$rpFieldelementName}'); - \${$fieldName}_select = new XoopsFormSelect({$language}, '{$fieldName}', \$this->getVar('{$fieldName}')); - \${$fieldName}_select->addOptionArray(\${$rpFieldelementName}Handler->getList()); - \$form->addElement( \${$fieldName}_select{$required} );\n + \${$ccFieldName}Select = new XoopsFormSelect({$language}, '{$fieldName}', \$this->getVar('{$fieldName}')); + \${$ccFieldName}Select->addOptionArray(\${$rpFieldelementName}Handler->getList()); + \$form->addElement( \${$ccFieldName}Select{$required} );\n EOT; return $ret; Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/include/IncludeCommon.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/include/IncludeCommon.php 2015-06-02 13:47:44 UTC (rev 13076) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/include/IncludeCommon.php 2015-06-03 09:42:10 UTC (rev 13077) @@ -114,6 +114,12 @@ define('{$stuModuleDirname}_UPLOAD_SHOTS_URL', {$stuModuleDirname}_UPLOAD_PATH.'/images/shots');\n EOT; } + if(in_array(array(11, 12), $fieldElement)) { + $ret .= <<<EOT + define('{$stuModuleDirname}_UPLOAD_FILES_PATH', {$stuModuleDirname}_UPLOAD_PATH.'/files'); + define('{$stuModuleDirname}_UPLOAD_FILES_URL', {$stuModuleDirname}_UPLOAD_PATH.'/files');\n +EOT; + } if(in_array(13, $fieldElement)) { $ret .= <<<EOT define('{$stuModuleDirname}_UPLOAD_IMAGE_PATH', {$stuModuleDirname}_UPLOAD_PATH.'/images'); Added: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/form/TDMCreateFormRaw.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/form/TDMCreateFormRaw.php (rev 0) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/form/TDMCreateFormRaw.php 2015-06-03 09:42:10 UTC (rev 13077) @@ -0,0 +1,47 @@ +<?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. +*/ +/** + * TDMCreateFormRaw - raw form element + * + * This class has special treatment by xoopsforms, it will render the raw + * value provided without wrapping in HTML + * + * @category Xoops\Form\Raw + * @package Xoops\Form + * @author trabis <tra...@gm...> + * @copyright 2012-2014 The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html) + * @link http://xoops.org + * @since 2.6.0 +*/ +class TDMCreateFormRaw extends XoopsFormElement +{ + + /** + * __construct + * + * @param string $value value + */ + public function __construct($value = '') + { + $this->setValue($value); + } + + /** + * render + * + * @return string rendered form element + */ + public function render() + { + return $this->getValue(); + } +} Added: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/form/TDMCreateFormTab.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/form/TDMCreateFormTab.php (rev 0) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/form/TDMCreateFormTab.php 2015-06-03 09:42:10 UTC (rev 13077) @@ -0,0 +1,70 @@ +<?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. +*/ +/** + * Tab - a form tab + * + * @category XoopsFormTab + * @package XoopsForm + * @author trabis <lus...@gm...> + * @copyright 2012-2014 The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html) + * @link http://xoops.org + * @since 2.0.0 +*/ +XoopsLoad::load('XoopsFormElementTray'); +class TDMCreateFormTab extends XoopsFormElementTray +{ + /** + * __construct + * + * @param string $caption tab caption + * @param string $name unique identifier for this tab + */ + public function __construct($caption, $name) + { + $this->setName($name); + $this->setCaption($caption); + } + + /** + * render + * + * @return string + */ + public function render() + { + $ret = ''; + /* @var $ele Element */ + foreach ($this->getElements() as $ele) { + $ret .= NWLINE; + $ret .= '<tr>' . NWLINE; + $ret .= '<td class="head" width="30%">' . NWLINE; + $required = $ele->isRequired() ? '-required' : ''; + $ret .= '<div class="xoops-form-element-caption' . $required . '">' . NWLINE; + $ret .= '<span class="caption-text">' . $ele->getCaption() . '</span>' . NWLINE; + $ret .= '<span class="caption-marker">*</span>' . NWLINE; + $ret .= '</div>' . NWLINE; + $description = $ele->getDescription(); + if ($description) { + $ret .= '<div style="font-weight: normal">' . NWLINE; + $ret .= $description . NWLINE; + $ret .= '</div>' . NWLINE; + } + $ret .= '</td>' . NWLINE; + $ret .= '<td class="even">' . NWLINE; + $ret .= $ele->render() . NWLINE; + $ret .= '<span class="form-horizontal">'. $ele->getDescription() . '</span>'; + $ret .= '</td>' . NWLINE; + $ret .= '</tr>' . NWLINE; + } + return $ret; + } +} Added: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/form/TDMCreateFormTabTray.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/form/TDMCreateFormTabTray.php (rev 0) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/form/TDMCreateFormTabTray.php 2015-06-03 09:42:10 UTC (rev 13077) @@ -0,0 +1,106 @@ +<?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. +*/ +/** + * TabTray - a form tray for tabs + * + * @category XoopsFormTabTray + * @package XoopsForm + * @author trabis <lus...@gm...> + * @copyright 2012-2014 The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html) + * @link http://xoops.org + * @since 2.0.0 +*/ +XoopsLoad::load('XoopsFormElementTray'); +class TDMCreateFormTabTray extends XoopsFormElementTray +{ + /** + * Theme to use for jquery UI + * + * @var string + */ + private $uiTheme = ''; + + /** + * __construct + * + * @param string $caption tray caption + * @param string $name Unique identifier for this tray + * @param string $uiTheme Theme to use for jquery UI (remove? now set by theme) + * @param string $delimiter delimiter + */ + public function __construct($caption, $name, $uiTheme = 'base', $delimiter = " ") + { + $this->setName($name); + $this->setCaption($caption); + $this->delimiter = $delimiter; + $this->uiTheme = $uiTheme; + } + + /** + * create HTML to output the form as a table + * + * @return string + */ + public function render() + { + $GLOBALS['xoTheme']->addScript('browse.php?Frameworks/jquery/jquery.js'); + $GLOBALS['xoTheme']->addScript('browse.php?Frameworks/jquery/plugins/jquery.ui.js'); + $GLOBALS['xoTheme']->addStylesheet( XOOPS_URL . '/modules/system/css/ui/' . $this->uiTheme . '/ui.all.css'); + $GLOBALS['xoTheme']->addScript('', array('type' => 'text/javascript'), '$(function() { $("#tabs_' . $this->getName() . '").tabs(); });'); + + $ret = '<div id="tabs_' . $this->getName() . '">' . NWLINE; + $ret .= '<ul>' . NWLINE; + foreach ($this->getElements() as $ele) { + if ($ele instanceof TDMCreateFormTab) { + $ret .= '<li><a href="#tab_' . $ele->getName() . '"><span>' + . $ele->getCaption() . '</span></a></li>' . NWLINE; + } + } + $ret .= '</ul>' . NWLINE; + + $hidden = ''; + $extras = array(); + + foreach ($this->getElements() as $ele) { + /* @var $ele Element */ + if (!$ele->isHidden()) { + if (!$ele instanceof TDMCreateFormRaw) { + if ($ele instanceof TDMCreateFormTab) { + $ret .= '<div id="tab_' . $ele->getName() . '">' . NWLINE; + $ret .= '<table class="outer" cellspacing="1">' . NWLINE; + $ret .= $ele->render(); + $ret .= '</table>' . NWLINE; + $ret .= '</div>' . NWLINE; + } else { + $extras[] = $ele; + } + } else { + $ret .= $ele->render(); + } + } else { + $hidden .= $ele->render(); + } + } + if (!empty($extras)) { + $tray = new ElementTray('', $this->getDelimiter()); + foreach ($extras as $extra) { + $tray->addElement($extra); + } + $ret .= $tray->render(); + $ret .= NWLINE; + } + + $ret .= $hidden . NWLINE; + $ret .= '</div>' . NWLINE; + return $ret; + } +} Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/modules.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/modules.php 2015-06-02 13:47:44 UTC (rev 13076) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/modules.php 2015-06-03 09:42:10 UTC (rev 13077) @@ -15,12 +15,13 @@ * @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.x + * @since 2.5.7 * @author TDM TEAM DEV MODULE * @version $Id: modules.php 12209 2013-10-23 02:49:09Z beckmi $ * @version $Id: modules.php 13040 2015-04-25 15:12:12Z timgno $ */ defined('XOOPS_ROOT_PATH') or die('Restricted access'); +include __DIR__ . '/autoload.php'; /* * @Class TDMCreateModules * @extends XoopsObject Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/settings.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/settings.php 2015-06-02 13:47:44 UTC (rev 13076) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/settings.php 2015-06-03 09:42:10 UTC (rev 13077) @@ -15,12 +15,12 @@ * @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.x + * @since 2.5.7 * @author TDM TEAM DEV MODULE * @version $Id: settings.php 13070 2015-05-19 12:24:20Z timgno $ */ defined('XOOPS_ROOT_PATH') or die('Restricted access'); - +include __DIR__ . '/autoload.php'; /* * @Class TDMCreateSettings * @extends XoopsObject @@ -141,80 +141,92 @@ $form = new XoopsThemeForm(_AM_TDMCREATE_SETTING_EDIT, 'settingform', $action, 'post'); $form->setExtra('enctype="multipart/form-data"'); - $form->addElement(new XoopsFormHidden('set_id', $this->getVar('set_id'))); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_SETTING_NAME, 'set_name', 50, 255, $this->getVar('set_name'))); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_SETTING_DIRNAME, 'set_dirname', 25, 255, $this->getVar('set_dirname'))); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_SETTING_VERSION, 'set_version', 10, 25, $this->getVar('set_version'))); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_SETTING_SINCE, 'set_since', 10, 25, $this->getVar('set_since'))); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_SETTING_MIN_PHP, 'set_min_php', 10, 25, $this->getVar('set_min_php'))); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_SETTING_MIN_XOOPS, 'set_min_xoops', 10, 25, $this->getVar('set_min_xoops'))); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_SETTING_MIN_ADMIN, 'set_min_admin', 10, 25, $this->getVar('set_min_admin'))); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_SETTING_MIN_MYSQL, 'set_min_mysql', 10, 25, $this->getVar('set_min_mysql'))); - $form->addElement(new XoopsFormTextArea(_AM_TDMCREATE_SETTING_DESCRIPTION, 'set_description', $this->getVar('set_description'), 4, 25)); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_SETTING_AUTHOR, 'set_author', 50, 255, $this->getVar('set_author'))); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_SETTING_LICENSE, 'set_license', 50, 255, $this->getVar('set_license'))); - $options_tray = new XoopsFormElementTray(_OPTIONS, '<br />'); - $mod_checkbox_all = new XoopsFormCheckBox('', "settingbox", 1); - $mod_checkbox_all->addOption('allbox', _AM_TDMCREATE_SETTING_ALL); - $mod_checkbox_all->setExtra(" onclick='xoopsCheckAll(\"settingform\", \"settingbox\");' "); - $mod_checkbox_all->setClass('xo-checkall'); - $options_tray->addElement($mod_checkbox_all); - $mod_admin = $isNew ? $this->tdmcreate->getConfig('display_admin') : $this->getVar('set_admin'); - $check_mod_admin = new XoopsFormCheckBox(' ', 'set_admin', $mod_admin); - $check_mod_admin->addOption(1, _AM_TDMCREATE_SETTING_ADMIN); - $options_tray->addElement($check_mod_admin); - $mod_user = $isNew ? $this->tdmcreate->getConfig('display_user') : $this->getVar('set_user'); - $check_mod_user = new XoopsFormCheckBox(' ', 'set_user', $mod_user); - $check_mod_user->addOption(1, _AM_TDMCREATE_SETTING_USER); - $options_tray->addElement($check_mod_user); - $mod_blocks = $isNew ? $this->tdmcreate->getConfig('active_blocks') : $this->getVar('set_blocks'); - $check_mod_blocks = new XoopsFormCheckBox(' ', 'set_blocks', $mod_blocks); - $check_mod_blocks->addOption(1, _AM_TDMCREATE_SETTING_BLOCKS); - $options_tray->addElement($check_mod_blocks); - $mod_search = $isNew ? $this->tdmcreate->getConfig('active_search') : $this->getVar('set_search'); - $check_mod_search = new XoopsFormCheckBox(' ', 'set_search', $mod_search); - $check_mod_search->addOption(1, _AM_TDMCREATE_SETTING_SEARCH); - $options_tray->addElement($check_mod_search); - $mod_comments = $isNew ? $this->tdmcreate->getConfig('active_comments') : $this->getVar('set_comments'); - $check_mod_comments = new XoopsFormCheckBox(' ', 'set_comments', $mod_comments); - $check_mod_comments->addOption(1, _AM_TDMCREATE_SETTING_COMMENTS); - $options_tray->addElement($check_mod_comments); - $mod_notifications = $isNew ? $this->tdmcreate->getConfig('active_notifications') : $this->getVar('set_notifications'); - $check_mod_notifications = new XoopsFormCheckBox(' ', 'set_notifications', $mod_notifications); - $check_mod_notifications->addOption(1, _AM_TDMCREATE_SETTING_NOTIFICATIONS); - $options_tray->addElement($check_mod_notifications); - $mod_permissions = $isNew ? $this->tdmcreate->getConfig('active_permissions') : $this->getVar('set_permissions'); - $check_mod_permissions = new XoopsFormCheckBox(' ', 'set_permissions', $mod_permissions); - $check_mod_permissions->addOption(1, _AM_TDMCREATE_SETTING_PERMISSIONS); - $options_tray->addElement($check_mod_permissions); - $mod_inroot_copy = $isNew ? $this->tdmcreate->getConfig('active_permissions') : $this->getVar('set_inroot_copy'); - $check_mod_inroot_copy = new XoopsFormCheckBox(' ', 'set_inroot_copy', $mod_inroot_copy); - $check_mod_inroot_copy->addOption(1, _AM_TDMCREATE_SETTING_INROOT_MODULES_COPY); - $options_tray->addElement($check_mod_inroot_copy); - $form->addElement($options_tray); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_SETTING_IMAGE, 'set_image', 30, 100, $this->getVar('set_image'))); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_SETTING_AUTHOR_MAIL, 'set_author_mail', 50, 255, $this->getVar('set_author_mail'))); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_SETTING_AUTHOR_WEBSITE_URL, 'set_author_website_url', 50, 255, $this->getVar('set_author_website_url'))); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_SETTING_AUTHOR_WEBSITE_NAME, 'set_author_website_name', 50, 255, $this->getVar('set_author_website_name'))); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_SETTING_CREDITS, 'set_credits', 50, 255, $this->getVar('set_credits'))); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_SETTING_RELEASE_INFO, 'set_release_info', 50, 255, $this->getVar('set_release_info'))); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_SETTING_RELEASE_FILE, 'set_release_file', 50, 255, $this->getVar('set_release_file'))); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_SETTING_MANUAL, 'set_manual', 50, 255, $this->getVar('set_manual'))); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_SETTING_MANUAL_FILE, 'set_manual_file', 50, 255, $this->getVar('set_manual_file'))); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_SETTING_DEMO_SITE_URL, 'set_demo_site_url', 50, 255, $this->getVar('set_demo_site_url'))); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_SETTING_DEMO_SITE_NAME, 'set_demo_site_name', 50, 255, $this->getVar('set_demo_site_name'))); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_SETTING_SUPPORT_URL, 'set_support_url', 50, 255, $this->getVar('set_support_url'))); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_SETTING_SUPPORT_NAME, 'set_support_name', 50, 255, $this->getVar('set_support_name'))); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_SETTING_WEBSITE_URL, 'set_website_url', 50, 255, $this->getVar('set_website_url'))); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_SETTING_WEBSITE_NAME, 'set_website_name', 50, 255, $this->getVar('set_website_name'))); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_SETTING_RELEASE, 'set_release', 50, 255, $this->getVar('set_release'))); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_SETTING_STATUS, 'set_status', 50, 255, $this->getVar('set_status'))); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_SETTING_PAYPAL_BUTTON, 'set_donations', 50, 255, $this->getVar('set_donations'))); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_SETTING_SUBVERSION, 'set_subversion', 50, 255, $this->getVar('set_subversion'))); + $tabTray = new TDMCreateFormTabTray('', 'uniqueid', xoops_getModuleOption('jquery_theme', 'system')); + // + $tab1 = new TDMCreateFormTab(_AM_TDMCREATE_IMPORTANT, 'important'); + // + $tab1->addElement(new XoopsFormHidden('set_id', $this->getVar('set_id'))); + $tab1->addElement(new XoopsFormText(_AM_TDMCREATE_SETTING_NAME, 'set_name', 50, 255, $this->getVar('set_name'))); + $tab1->addElement(new XoopsFormText(_AM_TDMCREATE_SETTING_DIRNAME, 'set_dirname', 25, 255, $this->getVar('set_dirname'))); + $tab1->addElement(new XoopsFormText(_AM_TDMCREATE_SETTING_VERSION, 'set_version', 10, 25, $this->getVar('set_version'))); + $tab1->addElement(new XoopsFormText(_AM_TDMCREATE_SETTING_SINCE, 'set_since', 10, 25, $this->getVar('set_since'))); + $tab1->addElement(new XoopsFormText(_AM_TDMCREATE_SETTING_MIN_PHP, 'set_min_php', 10, 25, $this->getVar('set_min_php'))); + $tab1->addElement(new XoopsFormText(_AM_TDMCREATE_SETTING_MIN_XOOPS, 'set_min_xoops', 10, 25, $this->getVar('set_min_xoops'))); + $tab1->addElement(new XoopsFormText(_AM_TDMCREATE_SETTING_MIN_ADMIN, 'set_min_admin', 10, 25, $this->getVar('set_min_admin'))); + $tab1->addElement(new XoopsFormText(_AM_TDMCREATE_SETTING_MIN_MYSQL, 'set_min_mysql', 10, 25, $this->getVar('set_min_mysql'))); + $tab1->addElement(new XoopsFormTextArea(_AM_TDMCREATE_SETTING_DESCRIPTION, 'set_description', $this->getVar('set_description'), 4, 25)); + $tab1->addElement(new XoopsFormText(_AM_TDMCREATE_SETTING_AUTHOR, 'set_author', 50, 255, $this->getVar('set_author'))); + $tab1->addElement(new XoopsFormText(_AM_TDMCREATE_SETTING_LICENSE, 'set_license', 50, 255, $this->getVar('set_license'))); + $tabTray->addElement($tab1); + // + $tab2 = new TDMCreateFormTab(_AM_TDMCREATE_OPTIONS_CHECK, 'options_check'); + $options_tray = new XoopsFormElementTray(_OPTIONS, '<br />'); + $mod_checkbox_all = new XoopsFormCheckBox('', "settingbox", 1); + $mod_checkbox_all->addOption('allbox', _AM_TDMCREATE_SETTING_ALL); + $mod_checkbox_all->setExtra(" onclick='xoopsCheckAll(\"settingform\", \"settingbox\");' "); + $mod_checkbox_all->setClass('xo-checkall'); + $options_tray->addElement($mod_checkbox_all); + $mod_admin = $isNew ? $this->tdmcreate->getConfig('display_admin') : $this->getVar('set_admin'); + $check_mod_admin = new XoopsFormCheckBox(' ', 'set_admin', $mod_admin); + $check_mod_admin->addOption(1, _AM_TDMCREATE_SETTING_ADMIN); + $options_tray->addElement($check_mod_admin); + $mod_user = $isNew ? $this->tdmcreate->getConfig('display_user') : $this->getVar('set_user'); + $check_mod_user = new XoopsFormCheckBox(' ', 'set_user', $mod_user); + $check_mod_user->addOption(1, _AM_TDMCREATE_SETTING_USER); + $options_tray->addElement($check_mod_user); + $mod_blocks = $isNew ? $this->tdmcreate->getConfig('active_blocks') : $this->getVar('set_blocks'); + $check_mod_blocks = new XoopsFormCheckBox(' ', 'set_blocks', $mod_blocks); + $check_mod_blocks->addOption(1, _AM_TDMCREATE_SETTING_BLOCKS); + $options_tray->addElement($check_mod_blocks); + $mod_search = $isNew ? $this->tdmcreate->getConfig('active_search') : $this->getVar('set_search'); + $check_mod_search = new XoopsFormCheckBox(' ', 'set_search', $mod_search); + $check_mod_search->addOption(1, _AM_TDMCREATE_SETTING_SEARCH); + $options_tray->addElement($check_mod_search); + $mod_comments = $isNew ? $this->tdmcreate->getConfig('active_comments') : $this->getVar('set_comments'); + $check_mod_comments = new XoopsFormCheckBox(' ', 'set_comments', $mod_comments); + $check_mod_comments->addOption(1, _AM_TDMCREATE_SETTING_COMMENTS); + $options_tray->addElement($check_mod_comments); + $mod_notifications = $isNew ? $this->tdmcreate->getConfig('active_notifications') : $this->getVar('set_notifications'); + $check_mod_notifications = new XoopsFormCheckBox(' ', 'set_notifications', $mod_notifications); + $check_mod_notifications->addOption(1, _AM_TDMCREATE_SETTING_NOTIFICATIONS); + $options_tray->addElement($check_mod_notifications); + $mod_permissions = $isNew ? $this->tdmcreate->getConfig('active_permissions') : $this->getVar('set_permissions'); + $check_mod_permissions = new XoopsFormCheckBox(' ', 'set_permissions', $mod_permissions); + $check_mod_permissions->addOption(1, _AM_TDMCREATE_SETTING_PERMISSIONS); + $options_tray->addElement($check_mod_permissions); + $mod_inroot_copy = $isNew ? $this->tdmcreate->getConfig('active_permissions') : $this->getVar('set_inroot_copy'); + $check_mod_inroot_copy = new XoopsFormCheckBox(' ', 'set_inroot_copy', $mod_inroot_copy); + $check_mod_inroot_copy->addOption(1, _AM_TDMCREATE_SETTING_INROOT_MODULES_COPY); + $options_tray->addElement($check_mod_inroot_copy); + $tab2->addElement($options_tray); + $tabTray->addElement($tab2); + // + $tab3 = new TDMCreateFormTab(_AM_TDMCREATE_NOT_IMPORTANT, 'not_important'); - $form->addElement(new XoopsFormHidden('op', 'save')); - $form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit')); - + $tab3->addElement(new XoopsFormText(_AM_TDMCREATE_SETTING_IMAGE, 'set_image', 30, 100, $this->getVar('set_image'))); + $tab3->addElement(new XoopsFormText(_AM_TDMCREATE_SETTING_AUTHOR_MAIL, 'set_author_mail', 50, 255, $this->getVar('set_author_mail'))); + $tab3->addElement(new XoopsFormText(_AM_TDMCREATE_SETTING_AUTHOR_WEBSITE_URL, 'set_author_website_url', 50, 255, $this->getVar('set_author_website_url'))); + $tab3->addElement(new XoopsFormText(_AM_TDMCREATE_SETTING_AUTHOR_WEBSITE_NAME, 'set_author_website_name', 50, 255, $this->getVar('set_author_website_name'))); + $tab3->addElement(new XoopsFormText(_AM_TDMCREATE_SETTING_CREDITS, 'set_credits', 50, 255, $this->getVar('set_credits'))); + $tab3->addElement(new XoopsFormText(_AM_TDMCREATE_SETTING_RELEASE_INFO, 'set_release_info', 50, 255, $this->getVar('set_release_info'))); + $tab3->addElement(new XoopsFormText(_AM_TDMCREATE_SETTING_RELEASE_FILE, 'set_release_file', 50, 255, $this->getVar('set_release_file'))); + $tab3->addElement(new XoopsFormText(_AM_TDMCREATE_SETTING_MANUAL, 'set_manual', 50, 255, $this->getVar('set_manual'))); + $tab3->addElement(new XoopsFormText(_AM_TDMCREATE_SETTING_MANUAL_FILE, 'set_manual_file', 50, 255, $this->getVar('set_manual_file'))); + $tab3->addElement(new XoopsFormText(_AM_TDMCREATE_SETTING_DEMO_SITE_URL, 'set_demo_site_url', 50, 255, $this->getVar('set_demo_site_url'))); + $tab3->addElement(new XoopsFormText(_AM_TDMCREATE_SETTING_DEMO_SITE_NAME, 'set_demo_site_name', 50, 255, $this->getVar('set_demo_site_name'))); + $tab3->addElement(new XoopsFormText(_AM_TDMCREATE_SETTING_SUPPORT_URL, 'set_support_url', 50, 255, $this->getVar('set_support_url'))); + $tab3->addElement(new XoopsFormText(_AM_TDMCREATE_SETTING_SUPPORT_NAME, 'set_support_name', 50, 255, $this->getVar('set_support_name'))); + $tab3->addElement(new XoopsFormText(_AM_TDMCREATE_SETTING_WEBSITE_URL, 'set_website_url', 50, 255, $this->getVar('set_website_url'))); + $tab3->addElement(new XoopsFormText(_AM_TDMCREATE_SETTING_WEBSITE_NAME, 'set_website_name', 50, 255, $this->getVar('set_website_name'))); + $tab3->addElement(new XoopsFormText(_AM_TDMCREATE_SETTING_RELEASE, 'set_release', 50, 255, $this->getVar('set_release'))); + $tab3->addElement(new XoopsFormText(_AM_TDMCREATE_SETTING_STATUS, 'set_status', 50, 255, $this->getVar('set_status'))); + $tab3->addElement(new XoopsFormText(_AM_TDMCREATE_SETTING_PAYPAL_BUTTON, 'set_donations', 50, 255, $this->getVar('set_donations'))); + $tab3->addElement(new XoopsFormText(_AM_TDMCREATE_SETTING_SUBVERSION, 'set_subversion', 50, 255, $this->getVar('set_subversion'))); + + $tab3->addElement(new XoopsFormHidden('op', 'save')); + $tab3->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit')); + $tabTray->addElement($tab3); + $form->addElement($tabTray); return $form; } } @@ -236,8 +248,7 @@ * * @param $i * @param $fields - * @return mixed reference to the <a href='psi_element://TDMCreateFields'>TDMCreateFields</a> object - * object + * @return mixed reference to the object */ public function &get($i = null, $fields = null) { @@ -248,7 +259,7 @@ /** * insert a new field in the database * - * @param object $field reference to the {@link TDMCreateFields} object + * @param $field object * @param bool $force * * @return bool FALSE if failed, TRUE if already present and unchanged or successful Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/tables.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/tables.php 2015-06-02 13:47:44 UTC (rev 13076) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/tables.php 2015-06-03 09:42:10 UTC (rev 13077) @@ -15,12 +15,12 @@ * @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 + * @since 2.5.7 * @author Txmod Xoops <su...@tx...> * @version $Id: 1.91 tables.php 11297 2013-03-24 10:58:10Z timgno $ */ defined('XOOPS_ROOT_PATH') or die('Restricted access'); - +include __DIR__ . '/autoload.php'; /* * @Class TDMCreateTables * @extends XoopsObject Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/language/english/admin.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/language/english/admin.php 2015-06-02 13:47:44 UTC (rev 13076) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/language/english/admin.php 2015-06-03 09:42:10 UTC (rev 13077) @@ -367,3 +367,6 @@ define('_AM_TDMCREATE_FIELD_PARAMETERS_LIST', "<b>Parameters List</b>"); // define('_AM_TDMCREATE_ABOUT_MAKE_DONATION', "Make a Donation to support this module"); +define('_AM_TDMCREATE_IMPORTANT', "Main Settings"); +define('_AM_TDMCREATE_OPTIONS_CHECK', "Options Settings"); +define('_AM_TDMCREATE_NOT_IMPORTANT', "Secondary Settings"); \ No newline at end of file |
From: <txm...@us...> - 2015-06-03 12:38:10
|
Revision: 13080 http://sourceforge.net/p/xoops/svn/13080 Author: txmodxoops Date: 2015-06-03 12:38:08 +0000 (Wed, 03 Jun 2015) Log Message: ----------- Added jquery ui tabs Modified Paths: -------------- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/fields.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/modules.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/tables.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/language/english/admin.php Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/fields.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/fields.php 2015-06-03 10:51:58 UTC (rev 13079) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/fields.php 2015-06-03 12:38:08 UTC (rev 13080) @@ -8,6 +8,7 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ + /** * tdmcreatereate module * Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/modules.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/modules.php 2015-06-03 10:51:58 UTC (rev 13079) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/modules.php 2015-06-03 12:38:08 UTC (rev 13080) @@ -17,7 +17,6 @@ * @package tdmcreate * @since 2.5.7 * @author TDM TEAM DEV MODULE - * @version $Id: modules.php 12209 2013-10-23 02:49:09Z beckmi $ * @version $Id: modules.php 13040 2015-04-25 15:12:12Z timgno $ */ defined('XOOPS_ROOT_PATH') or die('Restricted access'); @@ -185,36 +184,38 @@ // $form = new XoopsThemeForm($title, 'moduleform', $action, 'post', true); $form->setExtra('enctype="multipart/form-data"'); + // + $tabTray = new TDMCreateFormTabTray('', 'uniqueid', xoops_getModuleOption('jquery_theme', 'system')); + // + $tab1 = new TDMCreateFormTab(_AM_TDMCREATE_IMPORTANT, 'important'); // - $form->insertBreak('<div class="center"><b>' . _AM_TDMCREATE_MODULE_IMPORTANT . '</b></div>', 'head'); - // $modName = $isNew ? $set['name'] : $this->getVar('mod_name'); $modName = new XoopsFormText(_AM_TDMCREATE_MODULE_NAME, 'mod_name', 50, 255, $modName); $modName->setDescription(_AM_TDMCREATE_MODULE_NAME_DESC); - $form->addElement($modName, true); + $tab1->addElement($modName, true); // $modDirname = $isNew ? $set['dirname'] : $this->getVar('mod_dirname'); $modDirname = new XoopsFormText(_AM_TDMCREATE_MODULE_DIRNAME, 'mod_dirname', 25, 255, $modDirname); $modDirname->setDescription(_AM_TDMCREATE_MODULE_DIRNAME_DESC); - $form->addElement($modDirname, true); + $tab1->addElement($modDirname, true); // $modVersion = $isNew ? $set['version'] : $this->getVar('mod_version'); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_VERSION, 'mod_version', 10, 25, $modVersion), true); + $tab1->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_VERSION, 'mod_version', 10, 25, $modVersion), true); // $modSince = $isNew ? $set['since'] : $this->getVar('mod_since'); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_SINCE, 'mod_since', 10, 25, $modSince), true); + $tab1->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_SINCE, 'mod_since', 10, 25, $modSince), true); // $modMinPhp = $isNew ? $set['min_php'] : $this->getVar('mod_min_php'); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_MIN_PHP, 'mod_min_php', 10, 25, $modMinPhp), true); + $tab1->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_MIN_PHP, 'mod_min_php', 10, 25, $modMinPhp), true); // $modMinXoops = $isNew ? $set['min_xoops'] : $this->getVar('mod_min_xoops'); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_MIN_XOOPS, 'mod_min_xoops', 10, 25, $modMinXoops), true); + $tab1->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_MIN_XOOPS, 'mod_min_xoops', 10, 25, $modMinXoops), true); // $modMinAdmin = $isNew ? $set['min_admin'] : $this->getVar('mod_min_admin'); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_MIN_ADMIN, 'mod_min_admin', 10, 25, $modMinAdmin), true); + $tab1->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_MIN_ADMIN, 'mod_min_admin', 10, 25, $modMinAdmin), true); // $modMinMysql = $isNew ? $set['min_mysql'] : $this->getVar('mod_min_mysql'); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_MIN_MYSQL, 'mod_min_mysql', 10, 25, $modMinMysql), true); + $tab1->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_MIN_MYSQL, 'mod_min_mysql', 10, 25, $modMinMysql), true); // Name description $editor_configs = array(); $editor_configs['name'] = 'mod_description'; @@ -224,12 +225,15 @@ $editor_configs['width'] = '50%'; $editor_configs['height'] = '100px'; $editor_configs['editor'] = $this->tdmcreate->getConfig('tdmcreate_editor'); - $form->addElement(new XoopsFormEditor(_AM_TDMCREATE_MODULE_DESCRIPTION, 'mod_description', $editor_configs), true); + $tab1->addElement(new XoopsFormEditor(_AM_TDMCREATE_MODULE_DESCRIPTION, 'mod_description', $editor_configs), true); // Author $modAuthor = $isNew ? $set['author'] : $this->getVar('mod_author'); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_AUTHOR, 'mod_author', 50, 255, $modAuthor), true); + $tab1->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_AUTHOR, 'mod_author', 50, 255, $modAuthor), true); $modLicense = $isNew ? $set['license'] : $this->getVar('mod_license'); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_LICENSE, 'mod_license', 50, 255, $modLicense), true); + $tab1->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_LICENSE, 'mod_license', 50, 255, $modLicense), true); + $tabTray->addElement($tab1); + // + $tab2 = new TDMCreateFormTab(_AM_TDMCREATE_OPTIONS_CHECK, 'options_check'); // $options_tray = new XoopsFormElementTray(_OPTIONS, '<br />'); // @@ -278,9 +282,12 @@ $check_mod_inroot_copy = new XoopsFormCheckBox(' ', 'mod_inroot_copy', $mod_inroot_copy); $check_mod_inroot_copy->addOption(1, _AM_TDMCREATE_MODULE_INROOT_MODULES_COPY); $options_tray->addElement($check_mod_inroot_copy); + + $tab2->addElement($options_tray); + $tabTray->addElement($tab2); + // + $tab3 = new TDMCreateFormTab(_AM_TDMCREATE_CREATE_IMAGE, 'create_image'); // - $form->addElement($options_tray); - // $modImage = $this->getVar('mod_image'); $modImage = $modImage ? $modImage : $set['image']; // @@ -300,7 +307,7 @@ $fileseltray->addElement(new XoopsFormFile(_AM_TDMCREATE_FORMUPLOAD, 'attachedfile', $this->tdmcreate->getConfig('maxsize'))); $fileseltray->addElement(new XoopsFormLabel('')); $imgtray->addElement($fileseltray); - $form->addElement($imgtray); + $tab3->addElement($imgtray); //---------- START LOGO GENERATOR ----------------- $tables_img = $this->getVar('table_image') ?: 'about.png'; $iconsdir = '/Frameworks/moduleclasses/icons/32'; @@ -324,69 +331,73 @@ $buttonLogoGenerator4 = new XoopsFormButton('', 'button4', _AM_TDMCREATE_MODULE_CREATENEWLOGO, 'button'); $buttonLogoGenerator4->setExtra("onclick='createNewModuleLogo(\"" . TDMC_URL . "\")'"); $createLogoTray->addElement($buttonLogoGenerator4); - // - $form->addElement($createLogoTray); + //$options_tray $form->addElement(); + $tab3->addElement($createLogoTray); + $tabTray->addElement($tab3); + // + $tab4 = new TDMCreateFormTab(_AM_TDMCREATE_NOT_IMPORTANT, 'not_important'); //------------ END LOGO GENERATOR -------------------- // - $form->insertBreak('<div class="center"><b>' . _AM_TDMCREATE_MODULE_NOTIMPORTANT . '</b></div>', 'head'); - // $modAuthorMail = $isNew ? $set['author_mail'] : $this->getVar('mod_author_mail'); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_AUTHOR_MAIL, 'mod_author_mail', 50, 255, $modAuthorMail)); + $tab4->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_AUTHOR_MAIL, 'mod_author_mail', 50, 255, $modAuthorMail)); // $modAuthorWebsiteUrl = $isNew ? $set['author_website_url'] : $this->getVar('mod_author_website_url'); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_AUTHOR_WEBSITE_URL, 'mod_author_website_url', 50, 255, $modAuthorWebsiteUrl)); + $tab4->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_AUTHOR_WEBSITE_URL, 'mod_author_website_url', 50, 255, $modAuthorWebsiteUrl)); // $modAuthorWebsiteName = $isNew ? $set['author_website_name'] : $this->getVar('mod_author_website_name'); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_AUTHOR_WEBSITE_NAME, 'mod_author_website_name', 50, 255, $modAuthorWebsiteName)); + $tab4->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_AUTHOR_WEBSITE_NAME, 'mod_author_website_name', 50, 255, $modAuthorWebsiteName)); // $modCredits = $isNew ? $set['credits'] : $this->getVar('mod_credits'); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_CREDITS, 'mod_credits', 50, 255, $modCredits)); + $tab4->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_CREDITS, 'mod_credits', 50, 255, $modCredits)); // $modReleaseInfo = $isNew ? $set['release_info'] : $this->getVar('mod_release_info'); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_RELEASE_INFO, 'mod_release_info', 50, 255, $modReleaseInfo)); + $tab4->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_RELEASE_INFO, 'mod_release_info', 50, 255, $modReleaseInfo)); // $modReleaseFile = $isNew ? $set['release_file'] : $this->getVar('mod_release_file'); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_RELEASE_FILE, 'mod_release_file', 50, 255, $modReleaseFile)); + $tab4->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_RELEASE_FILE, 'mod_release_file', 50, 255, $modReleaseFile)); // $modManual = $isNew ? $set['manual'] : $this->getVar('mod_manual'); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_MANUAL, 'mod_manual', 50, 255, $modManual)); + $tab4->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_MANUAL, 'mod_manual', 50, 255, $modManual)); // $modManualFile = $isNew ? $set['manual_file'] : $this->getVar('mod_manual_file'); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_MANUAL_FILE, 'mod_manual_file', 50, 255, $modManualFile)); + $tab4->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_MANUAL_FILE, 'mod_manual_file', 50, 255, $modManualFile)); // $modDemoSiteUrl = $isNew ? $set['demo_site_url'] : $this->getVar('mod_demo_site_url'); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_DEMO_SITE_URL, 'mod_demo_site_url', 50, 255, $modDemoSiteUrl)); + $tab4->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_DEMO_SITE_URL, 'mod_demo_site_url', 50, 255, $modDemoSiteUrl)); // $modDemoSiteName = $isNew ? $set['demo_site_name'] : $this->getVar('mod_demo_site_name'); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_DEMO_SITE_NAME, 'mod_demo_site_name', 50, 255, $modDemoSiteName)); + $tab4->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_DEMO_SITE_NAME, 'mod_demo_site_name', 50, 255, $modDemoSiteName)); // $modSupportUrl = $isNew ? $set['support_url'] : $this->getVar('mod_support_url'); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_SUPPORT_URL, 'mod_support_url', 50, 255, $modSupportUrl)); + $tab4->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_SUPPORT_URL, 'mod_support_url', 50, 255, $modSupportUrl)); // $modSupportName = $isNew ? $set['support_name'] : $this->getVar('mod_support_name'); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_SUPPORT_NAME, 'mod_support_name', 50, 255, $modSupportName)); + $tab4->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_SUPPORT_NAME, 'mod_support_name', 50, 255, $modSupportName)); // $modWebsiteUrl = $isNew ? $set['website_url'] : $this->getVar('mod_website_url'); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_WEBSITE_URL, 'mod_website_url', 50, 255, $modWebsiteUrl)); + $tab4->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_WEBSITE_URL, 'mod_website_url', 50, 255, $modWebsiteUrl)); // $modWebsiteName = $isNew ? $set['website_name'] : $this->getVar('mod_website_name'); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_WEBSITE_NAME, 'mod_website_name', 50, 255, $modWebsiteName)); + $tab4->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_WEBSITE_NAME, 'mod_website_name', 50, 255, $modWebsiteName)); // $modRelease = $isNew ? $set['release'] : $this->getVar('mod_release'); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_RELEASE, 'mod_release', 50, 255, $modRelease)); + $tab4->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_RELEASE, 'mod_release', 50, 255, $modRelease)); // $modStatus = $isNew ? $set['status'] : $this->getVar('mod_status'); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_STATUS, 'mod_status', 50, 255, $modStatus)); + $tab4->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_STATUS, 'mod_status', 50, 255, $modStatus)); // $modDonations = $isNew ? $set['donations'] : $this->getVar('mod_donations'); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_PAYPAL_BUTTON, 'mod_donations', 50, 255, $modDonations)); + $tab4->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_PAYPAL_BUTTON, 'mod_donations', 50, 255, $modDonations)); // $modSubversion = $isNew ? $set['subversion'] : $this->getVar('mod_subversion'); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_SUBVERSION, 'mod_subversion', 50, 255, $modSubversion)); + $tab4->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_SUBVERSION, 'mod_subversion', 50, 255, $modSubversion)); // - $form->addElement(new XoopsFormHidden('op', 'save')); - $form->addElement(new XoopsFormButton(_REQUIRED . ' <span class="red bold">*</span>', 'submit', _SUBMIT, 'submit')); - + $buttonTray = new XoopsFormElementTray(_REQUIRED . ' <sup class="red bold">*</sup>', ''); + $buttonTray->addElement(new XoopsFormHidden('op', 'save')); + $buttonTray->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit')); + $tab4->addElement($buttonTray); + $tabTray->addElement($tab4); + $form->addElement($tabTray); return $form; } Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/tables.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/tables.php 2015-06-03 10:51:58 UTC (rev 13079) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/tables.php 2015-06-03 12:38:08 UTC (rev 13080) @@ -123,214 +123,223 @@ } $isNew = $this->isNew(); - $table_name = $this->getVar('table_name'); - $table_mid = $this->getVar('table_mid'); + $tableName = $this->getVar('table_name'); + $tableMid = $this->getVar('table_mid'); $title = $isNew ? sprintf(_AM_TDMCREATE_TABLE_NEW) : sprintf(_AM_TDMCREATE_TABLE_EDIT); xoops_load('xoopsformloader'); $form = new XoopsThemeForm($title, 'tableform', $action, 'post', true); $form->setExtra('enctype="multipart/form-data"'); + // + $tabTray = new TDMCreateFormTabTray('', 'uniqueid', xoops_getModuleOption('jquery_theme', 'system')); + // + $tab1 = new TDMCreateFormTab(_AM_TDMCREATE_IMPORTANT, 'important'); // - $modules = $this->tdmcreate->getHandler('modules')->getObjects(null); - $mods_select = new XoopsFormSelect(_AM_TDMCREATE_TABLE_MODULES, 'table_mid', $table_mid); - $mods_select->addOption('', _AM_TDMCREATE_TABLE_MODSELOPT); + $modules = $this->tdmcreate->getHandler('modules')->getObjects(null); + $modulesSelect = new XoopsFormSelect(_AM_TDMCREATE_TABLE_MODULES, 'table_mid', $tableMid); + $modulesSelect->addOption('', _AM_TDMCREATE_TABLE_MODSELOPT); foreach ($modules as $mod) { - //$mods_select->addOptionArray(); - $mods_select->addOption($mod->getVar('mod_id'), $mod->getVar('mod_name')); + //$modulesSelect->addOptionArray(); + $modulesSelect->addOption($mod->getVar('mod_id'), $mod->getVar('mod_name')); } - $form->addElement($mods_select, true); + $tab1->addElement($modulesSelect, true); // - $table_name_field = new XoopsFormText(_AM_TDMCREATE_TABLE_NAME, 'table_name', 40, 150, $table_name); - $table_name_field->setDescription(_AM_TDMCREATE_TABLE_NAME_DESC); - $form->addElement($table_name_field, true); + $tableNameText = new XoopsFormText(_AM_TDMCREATE_TABLE_NAME, 'table_name', 40, 150, $tableName); + $tableNameText->setDescription(_AM_TDMCREATE_TABLE_NAME_DESC); + $tab1->addElement($tableNameText, true); // - $table_solename_field = new XoopsFormText(_AM_TDMCREATE_TABLE_SOLENAME, 'table_solename', 40, 150, $this->getVar('table_solename')); - $table_solename_field->setDescription(_AM_TDMCREATE_TABLE_SOLENAME_DESC); - $form->addElement($table_solename_field, true); + $tableSoleNameText = new XoopsFormText(_AM_TDMCREATE_TABLE_SOLENAME, 'table_solename', 40, 150, $this->getVar('table_solename')); + $tableSoleNameText->setDescription(_AM_TDMCREATE_TABLE_SOLENAME_DESC); + $tab1->addElement($tableSoleNameText, true); // $tablesHandler =& $this->tdmcreate->getHandler('tables'); $criteria = new CriteriaCompo(new Criteria('table_category', 0), 'AND'); - $criteria->add(new Criteria('table_mid', $table_mid), 'AND'); - $criteria->add(new Criteria('table_name', $table_name)); - $table_category = $tablesHandler->getCount($criteria); + $criteria->add(new Criteria('table_mid', $tableMid), 'AND'); + $criteria->add(new Criteria('table_name', $tableName)); + $tableCategory = $tablesHandler->getCount($criteria); unset($criteria); - //if ( ($table_category == 0) || $isNew ) { - $radio_category = $isNew ? 0 : $this->getVar('table_category'); - $category = new XoopsFormRadioYN(_AM_TDMCREATE_TABLE_CATEGORY, 'table_category', $radio_category); + //if ( ($tableCategory == 0) || $isNew ) { + $radioCategory = $isNew ? 0 : $this->getVar('table_category'); + $category = new XoopsFormRadioYN(_AM_TDMCREATE_TABLE_CATEGORY, 'table_category', $radioCategory); $category->setDescription(_AM_TDMCREATE_TABLE_CATEGORY_DESC); - $form->addElement($category); + $tab1->addElement($category); //} // - $table_fieldname = new XoopsFormText(_AM_TDMCREATE_TABLE_FIELDNAME, 'table_fieldname', 30, 50, $this->getVar('table_fieldname')); - $table_fieldname->setDescription(_AM_TDMCREATE_TABLE_FIELDNAME_DESC); - $form->addElement($table_fieldname); + $tableFieldname = new XoopsFormText(_AM_TDMCREATE_TABLE_FIELDNAME, 'table_fieldname', 30, 50, $this->getVar('table_fieldname')); + $tableFieldname->setDescription(_AM_TDMCREATE_TABLE_FIELDNAME_DESC); + $tab1->addElement($tableFieldname); // - $table_nbfield = new XoopsFormText(_AM_TDMCREATE_TABLE_NBFIELDS, 'table_nbfields', 10, 25, $this->getVar('table_nbfields')); - $table_nbfield->setDescription(_AM_TDMCREATE_TABLE_NBFIELDS_DESC); - $form->addElement($table_nbfield, true); + $tableNumbFileds = new XoopsFormText(_AM_TDMCREATE_TABLE_NBFIELDS, 'table_nbfields', 10, 25, $this->getVar('table_nbfields')); + $tableNumbFileds->setDescription(_AM_TDMCREATE_TABLE_NBFIELDS_DESC); + $tab1->addElement($tableNumbFileds, true); // if (!$isNew) { - $table_order = new XoopsFormText(_AM_TDMCREATE_TABLE_ORDER, 'table_order', 5, 10, $this->getVar('table_order')); - $table_order->setDescription(_AM_TDMCREATE_TABLE_ORDER_DESC); - $form->addElement($table_order, true); + $tableOrder = new XoopsFormText(_AM_TDMCREATE_TABLE_ORDER, 'table_order', 5, 10, $this->getVar('table_order')); + $tableOrder->setDescription(_AM_TDMCREATE_TABLE_ORDER_DESC); + $tab1->addElement($tableOrder, true); } // - $get_table_image = $this->getVar('table_image'); - $table_image = $get_table_image ?: 'blank.gif'; - $iconsdir = '/Frameworks/moduleclasses/icons/32'; - $uploads_dir = '/uploads/tdmcreate/images/tables'; - $iconsdirectory = is_dir(XOOPS_ROOT_PATH . $iconsdir) ? $iconsdir : $uploads_dir; + $getTableImage = $this->getVar('table_image'); + $tableImage = $getTableImage ?: 'blank.gif'; + $icons32Directory = '/Frameworks/moduleclasses/icons/32'; + $uploadsDirectory = '/uploads/tdmcreate/images/tables'; + $iconsDirectory = is_dir(XOOPS_ROOT_PATH . $icons32Directory) ? $icons32Directory : $uploadsDirectory; // $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); - foreach ($image_array1 as $image1) { - $imageselect1->addOption("{$image1}", $image1); + $imgpath1 = sprintf(_AM_TDMCREATE_FORMIMAGE_PATH, ".{$iconsDirectory}/"); + $imageSelect1 = new XoopsFormSelect($imgpath1, 'table_image', $tableImage, 10); + $imageArray1 = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . $iconsDirectory); + foreach ($imageArray1 as $image1) { + $imageSelect1->addOption("{$image1}", $image1); } - $imageselect1->setExtra("onchange='showImgSelected(\"image1\", \"table_image\", \"" . $iconsdirectory . "\", \"\", \"" . XOOPS_URL . "\")'"); - $imgtray1->addElement($imageselect1, false); - $imgtray1->addElement(new XoopsFormLabel('', "<br /><img src='" . XOOPS_URL . "/" . $iconsdirectory . "/" . $table_image . "' name='image1' id='image1' alt='' />")); + $imageSelect1->setExtra("onchange='showImgSelected(\"image1\", \"table_image\", \"" . $iconsDirectory . "\", \"\", \"" . XOOPS_URL . "\")'"); + $imgtray1->addElement($imageSelect1, false); + $imgtray1->addElement(new XoopsFormLabel('', "<br /><img src='" . XOOPS_URL . "/" . $iconsDirectory . "/" . $tableImage . "' name='image1' id='image1' alt='' />")); $fileseltray1 = new XoopsFormElementTray('', '<br />'); $fileseltray1->addElement(new XoopsFormFile(_AM_TDMCREATE_FORMUPLOAD, 'attachedfile', $this->tdmcreate->getConfig('maxsize'))); $fileseltray1->addElement(new XoopsFormLabel('')); $imgtray1->addElement($fileseltray1); $imgtray1->setDescription(_AM_TDMCREATE_TABLE_IMAGE_DESC); - $form->addElement($imgtray1); + $tab1->addElement($imgtray1); // - $table_autoincrement = $this->isNew() ? 1 : $this->getVar('table_autoincrement'); - $check_table_autoincrement = new XoopsFormRadioYN(_AM_TDMCREATE_TABLE_AUTO_INCREMENT, 'table_autoincrement', $table_autoincrement); - $check_table_autoincrement->setDescription(_AM_TDMCREATE_TABLE_AUTO_INCREMENT_DESC); - //$check_table_autoincrement->addOption(1, _AM_TDMCREATE_TABLE_AUTO_INCREMENT_OPTION); - $form->addElement($check_table_autoincrement); + $tableAutoincrement = $this->isNew() ? 1 : $this->getVar('table_autoincrement'); + $checkTableAutoincrement = new XoopsFormRadioYN(_AM_TDMCREATE_TABLE_AUTO_INCREMENT, 'table_autoincrement', $tableAutoincrement); + $checkTableAutoincrement->setDescription(_AM_TDMCREATE_TABLE_AUTO_INCREMENT_DESC); + $tab1->addElement($checkTableAutoincrement); + $tabTray->addElement($tab1); + // + $tab2 = new TDMCreateFormTab(_AM_TDMCREATE_OPTIONS_CHECK, 'options_check'); // - $options_tray = new XoopsFormElementTray(_OPTIONS, '<br />'); + $optionsTray = new XoopsFormElementTray(_OPTIONS, '<br />'); // - $table_checkbox_all = new XoopsFormCheckBox('', "tablebox", 1); - $table_checkbox_all->addOption('allbox', _AM_TDMCREATE_TABLE_ALL); - $table_checkbox_all->setExtra(" onclick='xoopsCheckAll(\"tableform\", \"tablebox\");' "); - $table_checkbox_all->setClass('xo-checkall'); - $options_tray->addElement($table_checkbox_all); + $tableCheckAll = new XoopsFormCheckBox('', "tablebox", 1); + $tableCheckAll->addOption('allbox', _AM_TDMCREATE_TABLE_ALL); + $tableCheckAll->setExtra(" onclick='xoopsCheckAll(\"tableform\", \"tablebox\");' "); + $tableCheckAll->setClass('xo-checkall'); + $optionsTray->addElement($tableCheckAll); // - $table_index = $isNew ? 0 : $this->getVar('table_index'); - $check_table_index = new XoopsFormCheckBox(' ', 'table_index', $table_index); - $check_table_index->addOption(1, _AM_TDMCREATE_TABLE_INDEX); - $options_tray->addElement($check_table_index); + $tableIndex = $isNew ? 0 : $this->getVar('table_index'); + $checkTableIndex = new XoopsFormCheckBox(' ', 'table_index', $tableIndex); + $checkTableIndex->addOption(1, _AM_TDMCREATE_TABLE_INDEX); + $optionsTray->addElement($checkTableIndex); // - $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); + $tableBlocks = $isNew ? 0 : $this->getVar('table_blocks'); + $checkTableBlocks = new XoopsFormCheckBox(' ', 'table_blocks', $tableBlocks); + $checkTableBlocks->addOption(1, _AM_TDMCREATE_TABLE_BLOCKS); + $optionsTray->addElement($checkTableBlocks); // - $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); + $tableAdmin = $isNew ? 0 : $this->getVar('table_admin'); + $checkTableAdmin = new XoopsFormCheckBox(' ', 'table_admin', $tableAdmin); + $checkTableAdmin->addOption(1, _AM_TDMCREATE_TABLE_ADMIN); + $optionsTray->addElement($checkTableAdmin); // $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); + $checkTableUser = new XoopsFormCheckBox(' ', 'table_user', $table_user); + $checkTableUser->addOption(1, _AM_TDMCREATE_TABLE_USER); + $optionsTray->addElement($checkTableUser); // - $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); + $tableSubmenu = $isNew ? 0 : $this->getVar('table_submenu'); + $checkTableSubmenu = new XoopsFormCheckBox(' ', 'table_submenu', $tableSubmenu); + $checkTableSubmenu->addOption(1, _AM_TDMCREATE_TABLE_SUBMENU); + $optionsTray->addElement($checkTableSubmenu); // - $table_submit = $isNew ? 0 : $this->getVar('table_submit'); - $check_table_submit = new XoopsFormCheckBox(' ', 'table_submit', $table_submit); - $check_table_submit->addOption(1, _AM_TDMCREATE_TABLE_SUBMIT); - $options_tray->addElement($check_table_submit); + $tableSubmit = $isNew ? 0 : $this->getVar('table_submit'); + $checkTableSubmit = new XoopsFormCheckBox(' ', 'table_submit', $tableSubmit); + $checkTableSubmit->addOption(1, _AM_TDMCREATE_TABLE_SUBMIT); + $optionsTray->addElement($checkTableSubmit); // - $table_tag = $isNew ? 0 : $this->getVar('table_tag'); - $check_table_tag = new XoopsFormCheckBox(' ', 'table_tag', $table_tag); - $check_table_tag->addOption(1, _AM_TDMCREATE_TABLE_TAG); - $options_tray->addElement($check_table_tag); + $tableTag = $isNew ? 0 : $this->getVar('table_tag'); + $checkTableTag = new XoopsFormCheckBox(' ', 'table_tag', $tableTag); + $checkTableTag->addOption(1, _AM_TDMCREATE_TABLE_TAG); + $optionsTray->addElement($checkTableTag); // - $table_broken = $isNew ? 0 : $this->getVar('table_broken'); - $check_table_broken = new XoopsFormCheckBox(' ', 'table_broken', $table_broken); - $check_table_broken->addOption(1, _AM_TDMCREATE_TABLE_BROKEN); - $options_tray->addElement($check_table_broken); + $tableBroken = $isNew ? 0 : $this->getVar('table_broken'); + $checkTableBroken = new XoopsFormCheckBox(' ', 'table_broken', $tableBroken); + $checkTableBroken->addOption(1, _AM_TDMCREATE_TABLE_BROKEN); + $optionsTray->addElement($checkTableBroken); // $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); + $criteria->add(new Criteria('table_mid', $tableMid), 'AND'); + $criteria->add(new Criteria('table_name', $tableName)); + $tableComments = $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); + //if( ($tableComments == 0) || $isNew ) { + $tableSearch = $isNew ? 0 : $this->getVar('table_search'); + $checkTableSearch = new XoopsFormCheckBox(' ', 'table_search', $tableSearch); + $checkTableSearch->addOption(1, _AM_TDMCREATE_TABLE_SEARCH); + $optionsTray->addElement($checkTableSearch); //} // $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); + $criteria->add(new Criteria('table_mid', $tableMid), 'AND'); + $criteria->add(new Criteria('table_name', $tableName)); + $tableComments = $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); + //if ( ($tableComments == 0) || $isNew ) { + $tableComments = $isNew ? 0 : $this->getVar('table_comments'); + $checkTableComments = new XoopsFormCheckBox(' ', 'table_comments', $tableComments); + $checkTableComments->addOption(1, _AM_TDMCREATE_TABLE_COMMENTS); + $optionsTray->addElement($checkTableComments); //} // - $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); + $tableNotifications = $isNew ? 0 : $this->getVar('table_notifications'); + $checkTableNotifications = new XoopsFormCheckBox(' ', 'table_notifications', $tableNotifications); + $checkTableNotifications->addOption(1, _AM_TDMCREATE_TABLE_NOTIFICATIONS); + $optionsTray->addElement($checkTableNotifications); // $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); + $criteria->add(new Criteria('table_mid', $tableMid), 'AND'); + $criteria->add(new Criteria('table_name', $tableName)); + $tablePermissions = $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); + //if ( ($tablePermissions == 0) && ($tableCategory == 0) || $isNew ) { + $tablePermissions = $isNew ? 0 : $this->getVar('table_permissions'); + $checkTablePermissions = new XoopsFormCheckBox(' ', 'table_permissions', $tablePermissions); + $checkTablePermissions->addOption(1, _AM_TDMCREATE_TABLE_PERMISSIONS); + $optionsTray->addElement($checkTablePermissions); //} // - $table_rate = $isNew ? 0 : $this->getVar('table_rate'); - $check_table_rate = new XoopsFormCheckBox(' ', 'table_rate', $table_rate); - $check_table_rate->addOption(1, _AM_TDMCREATE_TABLE_RATE); - $options_tray->addElement($check_table_rate); + $tableRate = $isNew ? 0 : $this->getVar('table_rate'); + $checkTableRate = new XoopsFormCheckBox(' ', 'table_rate', $tableRate); + $checkTableRate->addOption(1, _AM_TDMCREATE_TABLE_RATE); + $optionsTray->addElement($checkTableRate); // - $table_print = $isNew ? 0 : $this->getVar('table_print'); - $check_table_print = new XoopsFormCheckBox(' ', 'table_print', $table_print); - $check_table_print->addOption(1, _AM_TDMCREATE_TABLE_PRINT); - $options_tray->addElement($check_table_print); + $tablePrint = $isNew ? 0 : $this->getVar('table_print'); + $checkTablePrint = new XoopsFormCheckBox(' ', 'table_print', $tablePrint); + $checkTablePrint->addOption(1, _AM_TDMCREATE_TABLE_PRINT); + $optionsTray->addElement($checkTablePrint); // - $table_pdf = $isNew ? 0 : $this->getVar('table_pdf'); - $check_table_pdf = new XoopsFormCheckBox(' ', 'table_pdf', $table_pdf); - $check_table_pdf->addOption(1, _AM_TDMCREATE_TABLE_PDF); - $options_tray->addElement($check_table_pdf); + $tablePdf = $isNew ? 0 : $this->getVar('table_pdf'); + $checkTablePdf = new XoopsFormCheckBox(' ', 'table_pdf', $tablePdf); + $checkTablePdf->addOption(1, _AM_TDMCREATE_TABLE_PDF); + $optionsTray->addElement($checkTablePdf); // - $table_rss = $isNew ? 0 : $this->getVar('table_rss'); - $check_table_rss = new XoopsFormCheckBox(' ', 'table_rss', $table_rss); - $check_table_rss->addOption(1, _AM_TDMCREATE_TABLE_RSS); - $options_tray->addElement($check_table_rss); + $tableRss = $isNew ? 0 : $this->getVar('table_rss'); + $checkTableRss = new XoopsFormCheckBox(' ', 'table_rss', $tableRss); + $checkTableRss->addOption(1, _AM_TDMCREATE_TABLE_RSS); + $optionsTray->addElement($checkTableRss); // - $table_single = $isNew ? 0 : $this->getVar('table_single'); - $check_table_single = new XoopsFormCheckBox(' ', 'table_single', $table_single); - $check_table_single->addOption(1, _AM_TDMCREATE_TABLE_SINGLE); - $options_tray->addElement($check_table_single); + $tableSingle = $isNew ? 0 : $this->getVar('table_single'); + $checkTableSingle = new XoopsFormCheckBox(' ', 'table_single', $tableSingle); + $checkTableSingle->addOption(1, _AM_TDMCREATE_TABLE_SINGLE); + $optionsTray->addElement($checkTableSingle); // - $table_visit = $isNew ? 0 : $this->getVar('table_visit'); - $check_table_visit = new XoopsFormCheckBox(' ', 'table_visit', $table_visit); - $check_table_visit->addOption(1, _AM_TDMCREATE_TABLE_VISIT); - $options_tray->addElement($check_table_visit); + $tableVisit = $isNew ? 0 : $this->getVar('table_visit'); + $checkTableVisit = new XoopsFormCheckBox(' ', 'table_visit', $tableVisit); + $checkTableVisit->addOption(1, _AM_TDMCREATE_TABLE_VISIT); + $optionsTray->addElement($checkTableVisit); // - $options_tray->setDescription(_AM_TDMCREATE_TABLE_OPTIONS_CHECKS_DESC); + $optionsTray->setDescription(_AM_TDMCREATE_TABLE_OPTIONS_CHECKS_DESC); // - $form->addElement($options_tray); + $tab2->addElement($optionsTray); // - $form->addElement(new XoopsFormHidden('op', 'save')); - $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')); - + $buttonTray = new XoopsFormElementTray(_REQUIRED . ' <sup class="red bold">*</sup>', ''); + $buttonTray->addElement(new XoopsFormHidden('op', 'save')); + $buttonTray->addElement(new XoopsFormHidden('table_id', ($isNew ? 0 : $this->getVar('table_id')))); + $buttonTray->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit')); + $tab2->addElement($buttonTray); + $tabTray->addElement($tab2); + $form->addElement($tabTray); return $form; } Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/language/english/admin.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/language/english/admin.php 2015-06-03 10:51:58 UTC (rev 13079) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/language/english/admin.php 2015-06-03 12:38:08 UTC (rev 13080) @@ -369,4 +369,5 @@ define('_AM_TDMCREATE_ABOUT_MAKE_DONATION', "Make a Donation to support this module"); define('_AM_TDMCREATE_IMPORTANT', "Main Settings"); define('_AM_TDMCREATE_OPTIONS_CHECK', "Options Settings"); +define('_AM_TDMCREATE_CREATE_IMAGE', "Create Image Logo"); define('_AM_TDMCREATE_NOT_IMPORTANT', "Secondary Settings"); \ No newline at end of file |
From: <txm...@us...> - 2015-06-09 17:54:03
|
Revision: 13085 http://sourceforge.net/p/xoops/svn/13085 Author: txmodxoops Date: 2015-06-09 17:53:59 +0000 (Tue, 09 Jun 2015) Log Message: ----------- Added template list Added more fields in database Refactoring Fixed seceral bugs Updated existing files and renamed Neede a fresh installation Modified Paths: -------------- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/building.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/fields.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/modules.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/settings.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/tables.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/assets/js/sortable.js XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/autoload.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/fields.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateArchitecture.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateFile.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateHtmlSmartyCodes.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateTableFields.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/admin/AdminMenu.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/admin/AdminObjects.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/admin/AdminPages.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/admin/AdminPermissions.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/blocks/BlocksFiles.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/classes/ClassFiles.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/classes/ClassFormElements.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/css/CssStyles.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/include/IncludeCommon.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/include/IncludeFunctions.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/include/IncludeInstall.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/language/LanguageMain.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/language/LanguageModinfo.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/sql/SqlFile.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/admin/TemplatesAdminPages.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/blocks/TemplatesBlocks.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/user/TemplatesUserBreadcrumbs.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/user/TemplatesUserFooter.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/user/TemplatesUserHeader.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/user/TemplatesUserIndex.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/user/TemplatesUserPages.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/user/UserFooter.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/user/UserHeader.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/user/UserIndex.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/user/UserPages.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/user/UserXoopsVersion.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/logoGenerator.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/modules.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/settings.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/tables.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/include/common.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/language/english/admin.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/language/english/help/help.html XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/sql/mysql.sql XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/templates/admin/tdmcreate_fields_item.tpl XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/templates/admin/tdmcreate_tables_item.tpl Added Paths: ----------- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/user/TemplatesUserPagesList.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/helper.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/session.php Removed Paths: ------------- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/TDMCreateHelper.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/TDMCreateSession.php Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/building.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/building.php 2015-06-09 02:59:11 UTC (rev 13084) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/building.php 2015-06-09 17:53:59 UTC (rev 13085) @@ -23,11 +23,11 @@ $mid = XoopsRequest::getInt('mod_id'); $moduleObj = $tdmcreate->getHandler('modules')->get($mid); // Clear cache -$cacheFile1 = TDMC_CLASSES_PATH . '/cache/classpaths.cache'; -$cacheFile2 = TDMC_CLASSES_PATH . '/files/cache/classpaths.cache'; -if (file_exists($cacheFile1) && file_exists($cacheFile2)) { - unlink($cacheFile1); - unlink($cacheFile2); +if (file_exists($cacheFile1 = TDMC_CLASSES_PATH . '/cache/classpaths.cache') && + file_exists($cacheFile2 = TDMC_CLASSES_PATH . '/files/cache/classpaths.cache')) { + if (unlink($cacheFile1) && unlink($cacheFile2)) { + redirect_header('building.php?op=build', 5, _AM_TDMCREATE_BUILDING_DELETED_CACHE_FILES); + } } // Switch option switch ($op) { Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/fields.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/fields.php 2015-06-09 02:59:11 UTC (rev 13084) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/fields.php 2015-06-09 17:53:59 UTC (rev 13085) @@ -129,38 +129,41 @@ $fields = $tdmcreate->getHandler('fields'); $fieldOrder = 1; // Set Variables - foreach($_POST['field_id'] as $key => $value) + foreach($_POST['field_id'] as $key => $value) { if(isset($value)){ $fieldsObj =& $fields->get($value); } else { $fieldsObj =& $fields->create(); } - $order = $fieldsObj->isNew() ? $fieldOrder : XoopsRequest::getInt('field_order'); + $order = $fieldsObj->isNew() ? $fieldOrder : $_GET['field_order'][$key]; // Set Data $fieldsObj->setVar( 'field_mid', $fieldMid ); - $fieldsObj->setVar( 'field_tid', $fieldTid ); + $fieldsObj->setVar( 'field_tid', $fieldTid ); $fieldsObj->setVar( 'field_order', $order ); $fieldsObj->setVar( 'field_name', $_POST['field_name'][$key]); - $fieldsObj->setVar( 'field_type', $_POST['field_type'][$key]); + $fieldsObj->setVar( 'field_type', $_POST['field_type'][$key]); $fieldsObj->setVar( 'field_value', $_POST['field_value'][$key]); $fieldsObj->setVar( 'field_attribute', $_POST['field_attribute'][$key]); - $fieldsObj->setVar( 'field_null', $_POST['field_null'][$key]); - $fieldsObj->setVar( 'field_default', $_POST['field_default'][$key]); - $fieldsObj->setVar( 'field_key', $_POST['field_key'][$key]); - $fieldsObj->setVar( 'field_element', $_POST['field_element'][$key]); + $fieldsObj->setVar( 'field_null', $_POST['field_null'][$key]); + $fieldsObj->setVar( 'field_default', $_POST['field_default'][$key]); + $fieldsObj->setVar( 'field_key', $_POST['field_key'][$key]); + $fieldsObj->setVar( 'field_element', $_POST['field_element'][$key]); $fieldsObj->setVar( 'field_parent', (1 == $_REQUEST['field_parent'][$key]) ? 1 : 0); + $fieldsObj->setVar( 'field_admin', (1 == $_REQUEST['field_admin'][$key]) ? 1 : 0); $fieldsObj->setVar( 'field_inlist', (1 == $_REQUEST['field_inlist'][$key]) ? 1 : 0); $fieldsObj->setVar( 'field_inform', (1 == $_REQUEST['field_inform'][$key]) ? 1 : 0); - $fieldsObj->setVar( 'field_admin', (1 == $_REQUEST['field_admin'][$key]) ? 1 : 0); - $fieldsObj->setVar( 'field_user', (1 == $_REQUEST['field_user'][$key]) ? 1 : 0); - $fieldsObj->setVar( 'field_block', (1 == $_REQUEST['field_block'][$key]) ? 1 : 0); - $fieldsObj->setVar( 'field_main', ($key == $_REQUEST['field_main'] ? 1 : 0)); - $fieldsObj->setVar( 'field_search', (1 == $_REQUEST['field_search'][$key]) ? 1 : 0); + $fieldsObj->setVar( 'field_user', (1 == $_REQUEST['field_user'][$key]) ? 1 : 0); + $fieldsObj->setVar( 'field_thead', (1 == $_REQUEST['field_thead'][$key]) ? 1 : 0); + $fieldsObj->setVar( 'field_tbody', (1 == $_REQUEST['field_tbody'][$key]) ? 1 : 0); + $fieldsObj->setVar( 'field_tfoot', (1 == $_REQUEST['field_tfoot'][$key]) ? 1 : 0); + $fieldsObj->setVar( 'field_block', (1 == $_REQUEST['field_block'][$key]) ? 1 : 0); + $fieldsObj->setVar( 'field_main', ($key == $_REQUEST['field_main'] ? 1 : 0)); + $fieldsObj->setVar( 'field_search', (1 == $_REQUEST['field_search'][$key]) ? 1 : 0); $fieldsObj->setVar( 'field_required', (1 == $_REQUEST['field_required'][$key]) ? 1 : 0); // Insert Data $tdmcreate->getHandler('fields')->insert($fieldsObj); - $fieldOrder++; + ++$fieldOrder; } unset($fieldOrder); // Get table name from field table id Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/modules.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/modules.php 2015-06-09 02:59:11 UTC (rev 13084) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/modules.php 2015-06-09 17:53:59 UTC (rev 13085) @@ -131,18 +131,19 @@ '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' => ((1 == $_REQUEST['mod_admin']) ? 1 : 0), - 'mod_user' => ((1 == $_REQUEST['mod_user']) ? 1 : 0), - 'mod_blocks' => ((1 == $_REQUEST['mod_blocks']) ? 1 : 0), - 'mod_search' => ((1 == $_REQUEST['mod_search']) ? 1 : 0), - 'mod_comments' => ((1 == $_REQUEST['mod_comments']) ? 1 : 0), - 'mod_notifications' => ((1 == $_REQUEST['mod_notifications']) ? 1 : 0), - 'mod_permissions' => ((1 == $_REQUEST['mod_permissions']) ? 1 : 0), - 'mod_inroot_copy' => ((1 == $_REQUEST['mod_inroot_copy']) ? 1 : 0), + 'mod_status' => $_POST['mod_status'], 'mod_donations' => $_POST['mod_donations'], 'mod_subversion' => $_POST['mod_subversion']) ); + $moduleOption = XoopsRequest::getArray('module_option', array()); + $modulesObj->setVar('mod_admin', in_array('admin', $moduleOption)); + $modulesObj->setVar('mod_user', in_array('user', $moduleOption)); + $modulesObj->setVar('mod_blocks', in_array('blocks', $moduleOption)); + $modulesObj->setVar('mod_search', in_array('search', $moduleOption)); + $modulesObj->setVar('mod_comments', in_array('comments', $moduleOption)); + $modulesObj->setVar('mod_notifications', in_array('notifications', $moduleOption)); + $modulesObj->setVar('mod_permissions', in_array('permissions', $moduleOption)); + $modulesObj->setVar('mod_inroot_copy', in_array('inroot', $moduleOption)); if ($tdmcreate->getHandler('modules')->insert($modulesObj)) { if ($modulesObj->isNew()) { Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/settings.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/settings.php 2015-06-09 02:59:11 UTC (rev 13084) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/settings.php 2015-06-09 17:53:59 UTC (rev 13085) @@ -75,18 +75,19 @@ 'set_website_url' => $_POST['set_website_url'], 'set_website_name' => $_POST['set_website_name'], 'set_release' => $_POST['set_release'], - 'set_status' => $_POST['set_status'], - 'set_admin' => ((1 == $_REQUEST['set_admin']) ? 1 : 0), - 'set_user' => ((1 == $_REQUEST['set_user']) ? 1 : 0), - 'set_blocks' => ((1 == $_REQUEST['set_blocks']) ? 1 : 0), - 'set_search' => ((1 == $_REQUEST['set_search']) ? 1 : 0), - 'set_comments' => ((1 == $_REQUEST['set_comments']) ? 1 : 0), - 'set_notifications' => ((1 == $_REQUEST['set_notifications']) ? 1 : 0), - 'set_permissions' => ((1 == $_REQUEST['set_permissions']) ? 1 : 0), - 'set_inroot_copy' => ((1 == $_REQUEST['set_inroot_copy']) ? 1 : 0), + 'set_status' => $_POST['set_status'], 'set_donations' => $_POST['set_donations'], 'set_subversion' => $_POST['set_subversion']) ); + $settingOption = XoopsRequest::getArray('setting_option', array()); + $settingsObj->setVar('set_admin', in_array('admin', $settingOption)); + $settingsObj->setVar('set_user', in_array('user', $settingOption)); + $settingsObj->setVar('set_blocks', in_array('blocks', $settingOption)); + $settingsObj->setVar('set_search', in_array('search', $settingOption)); + $settingsObj->setVar('set_comments', in_array('comments', $settingOption)); + $settingsObj->setVar('set_notifications', in_array('notifications', $settingOption)); + $settingsObj->setVar('set_permissions', in_array('permissions', $settingOption)); + $settingsObj->setVar('set_inroot_copy', in_array('inroot', $settingOption)); if ($tdmcreate->getHandler('settings')->insert($settingsObj)) { redirect_header('settings.php', 5, sprintf(_AM_TDMCREATE_MODULE_FORM_UPDATED_OK, $_POST['set_name'])); Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/tables.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/tables.php 2015-06-09 02:59:11 UTC (rev 13084) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/tables.php 2015-06-09 17:53:59 UTC (rev 13085) @@ -133,7 +133,7 @@ $tablesObj =& $tables->create(); } $tableOrder = XoopsRequest::getInt('table_order'); - $order = $tablesObj->isNew() ? $tableOrder + 1 : $tableOrder; + $order = $tablesObj->isNew() ? $tableOrder + 1: $tableOrder; // Form save tables $tablesObj->setVars(array( 'table_mid' => $tableMid, @@ -159,27 +159,28 @@ } else { $tablesObj->setVar('table_image', $_POST['table_image']); } - $tablesObj->setVars(array( - 'table_autoincrement' => ((1 == $_REQUEST['table_autoincrement']) ? 1 : 0), - 'table_index' => ((1 == $_REQUEST['table_index']) ? 1 : 0), - 'table_blocks' => ((1 == $_REQUEST['table_blocks']) ? 1 : 0), - 'table_admin' => ((1 == $_REQUEST['table_admin']) ? 1 : 0), - 'table_user' => ((1 == $_REQUEST['table_user']) ? 1 : 0), - 'table_submenu' => ((1 == $_REQUEST['table_submenu']) ? 1 : 0), - 'table_submit' => ((1 == $_REQUEST['table_submit']) ? 1 : 0), - 'table_tag' => ((1 == $_REQUEST['table_tag']) ? 1 : 0), - 'table_broken' => ((1 == $_REQUEST['table_broken']) ? 1 : 0), - 'table_search' => ((1 == $_REQUEST['table_search']) ? 1 : 0), - 'table_comments' => ((1 == $_REQUEST['table_comments']) ? 1 : 0), - 'table_notifications' => ((1 == $_REQUEST['table_notifications']) ? 1 : 0), - 'table_permissions' => ((1 == $_REQUEST['table_permissions']) ? 1 : 0), - 'table_rate' => ((1 == $_REQUEST['table_rate']) ? 1 : 0), - 'table_print' => ((1 == $_REQUEST['table_print']) ? 1 : 0), - 'table_pdf' => ((1 == $_REQUEST['table_pdf']) ? 1 : 0), - 'table_rss' => ((1 == $_REQUEST['table_rss']) ? 1 : 0), - 'table_single' => ((1 == $_REQUEST['table_single']) ? 1 : 0), - 'table_visit' => ((1 == $_REQUEST['table_visit']) ? 1 : 0) - )); + $tablesObj->setVar( 'table_autoincrement', (1 == $_REQUEST['table_autoincrement']) ? 1 : 0 ); + // Options + $tableOption = XoopsRequest::getArray('table_option', array()); + $tablesObj->setVar('table_install', in_array('install', $tableOption)); + $tablesObj->setVar('table_index', in_array('index', $tableOption)); + $tablesObj->setVar('table_blocks', in_array('blocks', $tableOption)); + $tablesObj->setVar('table_admin', in_array('admin', $tableOption)); + $tablesObj->setVar('table_user', in_array('user', $tableOption)); + $tablesObj->setVar('table_submenu', in_array('submenu', $tableOption)); + $tablesObj->setVar('table_submit', in_array('submit', $tableOption)); + $tablesObj->setVar('table_tag', in_array('tag', $tableOption)); + $tablesObj->setVar('table_broken', in_array('broken', $tableOption)); + $tablesObj->setVar('table_search', in_array('search', $tableOption)); + $tablesObj->setVar('table_comments', in_array('comments', $tableOption)); + $tablesObj->setVar('table_notifications', in_array('notifications', $tableOption)); + $tablesObj->setVar('table_permissions', in_array('permissions', $tableOption)); + $tablesObj->setVar('table_rate', in_array('rate', $tableOption)); + $tablesObj->setVar('table_print', in_array('print', $tableOption)); + $tablesObj->setVar('table_pdf', in_array('pdf', $tableOption)); + $tablesObj->setVar('table_rss', in_array('rss', $tableOption)); + $tablesObj->setVar('table_single', in_array('single', $tableOption)); + $tablesObj->setVar('table_visit', in_array('visit', $tableOption)); // if ($tables->insert($tablesObj)) { if ($tablesObj->isNew()) { @@ -251,32 +252,32 @@ if ($modId > 0) { $modulesObj = $tdmcreate->getHandler('modules')->get($modId); if (isset($_POST['mod_admin'])) { - $mod_admin = $modulesObj->getVar('mod_admin'); - $modulesObj->setVar('mod_admin', !$mod_admin); + $modAdmin = $modulesObj->getVar('mod_admin'); + $modulesObj->setVar('mod_admin', !$modAdmin); } if (isset($_POST['mod_user'])) { $mod_user = $modulesObj->getVar('mod_user'); $modulesObj->setVar('mod_user', !$mod_user); } if (isset($_POST['mod_blocks'])) { - $mod_blocks = $modulesObj->getVar('mod_blocks'); - $modulesObj->setVar('mod_blocks', !$mod_blocks); + $modBlocks = $modulesObj->getVar('mod_blocks'); + $modulesObj->setVar('mod_blocks', !$modBlocks); } if (isset($_POST['mod_search'])) { - $mod_search = $modulesObj->getVar('mod_search'); - $modulesObj->setVar('mod_search', !$mod_search); + $modSearch = $modulesObj->getVar('mod_search'); + $modulesObj->setVar('mod_search', !$modSearch); } if (isset($_POST['mod_comments'])) { - $mod_comments = $modulesObj->getVar('mod_comments'); - $modulesObj->setVar('mod_comments', !$mod_comments); + $modComments = $modulesObj->getVar('mod_comments'); + $modulesObj->setVar('mod_comments', !$modComments); } if (isset($_POST['mod_notifications'])) { - $mod_notifications = $modulesObj->getVar('mod_notifications'); - $modulesObj->setVar('mod_notifications', !$mod_notifications); + $modNotifications = $modulesObj->getVar('mod_notifications'); + $modulesObj->setVar('mod_notifications', !$modNotifications); } if (isset($_POST['mod_permissions'])) { - $mod_permissions = $modulesObj->getVar('mod_permissions'); - $modulesObj->setVar('mod_permissions', !$mod_permissions); + $modPermissions = $modulesObj->getVar('mod_permissions'); + $modulesObj->setVar('mod_permissions', !$modPermissions); } if ($tdmcreate->getHandler('modules')->insert($modulesObj)) { redirect_header('modules.php', 3, _AM_TDMCREATE_TOGGLE_SUCCESS); @@ -288,32 +289,36 @@ if ($tableId > 0) { $tablesObj = $tdmcreate->getHandler('tables')->get($tableId); if (isset($_POST['table_admin'])) { - $table_admin = $tablesObj->getVar('table_admin'); - $tablesObj->setVar('table_admin', !$table_admin); + $tableAdmin = $tablesObj->getVar('table_admin'); + $tablesObj->setVar('table_admin', !$tableAdmin); } if (isset($_POST['table_user'])) { - $table_user = $tablesObj->getVar('table_user'); - $tablesObj->setVar('table_user', !$table_user); + $tableUser = $tablesObj->getVar('table_user'); + $tablesObj->setVar('table_user', !$tableUser); } if (isset($_POST['table_blocks'])) { - $table_blocks = $tablesObj->getVar('table_blocks'); - $tablesObj->setVar('table_blocks', !$table_blocks); + $tableBlocks = $tablesObj->getVar('table_blocks'); + $tablesObj->setVar('table_blocks', !$tableBlocks); } + if (isset($_POST['table_submenu'])) { + $tableSubmenu = $tablesObj->getVar('table_submenu'); + $tablesObj->setVar('table_submenu', !$tableSubmenu); + } if (isset($_POST['table_search'])) { - $table_search = $tablesObj->getVar('table_search'); - $tablesObj->setVar('table_search', !$table_search); + $tableSearch = $tablesObj->getVar('table_search'); + $tablesObj->setVar('table_search', !$tableSearch); } if (isset($_POST['table_comments'])) { - $table_comments = $tablesObj->getVar('table_comments'); - $tablesObj->setVar('table_comments', !$table_comments); + $tableComments = $tablesObj->getVar('table_comments'); + $tablesObj->setVar('table_comments', !$tableComments); } if (isset($_POST['table_notifications'])) { - $table_notifications = $tablesObj->getVar('table_notifications'); - $tablesObj->setVar('table_notifications', !$table_notifications); + $tableNotifications = $tablesObj->getVar('table_notifications'); + $tablesObj->setVar('table_notifications', !$tableNotifications); } if (isset($_POST['table_permissions'])) { - $table_permissions = $tablesObj->getVar('table_permissions'); - $tablesObj->setVar('table_permissions', !$table_permissions); + $tablePermissions = $tablesObj->getVar('table_permissions'); + $tablesObj->setVar('table_permissions', !$tablePermissions); } if ($tdmcreate->getHandler('tables')->insert($tablesObj)) { redirect_header('tables.php', 3, _AM_TDMCREATE_TOGGLE_SUCCESS); Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/assets/js/sortable.js =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/assets/js/sortable.js 2015-06-09 02:59:11 UTC (rev 13084) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/assets/js/sortable.js 2015-06-09 17:53:59 UTC (rev 13085) @@ -3,7 +3,7 @@ $(document).ready( function(){ /* Call the container items to reorder tables */ $('.table-list').sortable({ - accept: 'tdmc-tables', + accept: 'tables', opacity: 0.6, handle : '.move', cursor: 'move', @@ -19,8 +19,8 @@ } ).disableSelection(); /* Call the container items to reorder fields */ - $('.field-list').sortable({ - accept: 'tdmc-fields', + $('.field-list').sortable({ + accept: 'fields', opacity: 0.6, handle : '.move', cursor: 'move', Deleted: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/TDMCreateHelper.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/TDMCreateHelper.php 2015-06-09 02:59:11 UTC (rev 13084) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/TDMCreateHelper.php 2015-06-09 17:53:59 UTC (rev 13085) @@ -1,220 +0,0 @@ -<?php -/* - You may not change or alter any portion of this comment or credits - of supporting developers from this source code or any supporting source code - which is considered copyrighted (c) material of the original comment or credit authors. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - */ -/** - * tdmcreate module - * - * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ - * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) - * @package tdmcreate - * @since 2.5.0 - * @author trabis <lus...@gm...> - * @version $Id: TDMCreateHelper.php 12258 2014-04-12 23:45:12Z timgno $ - */ -defined('XOOPS_ROOT_PATH') or die('Restricted access'); - -/** - * Class TDMCreateHelper - */ -class TDMCreateHelper -{ - /** - * @var string - */ - private $dirname; - /** - * @var string - */ - private $module; - /** - * @var string - */ - private $handler; - /** - * @var string - */ - private $config; - /** - * @var string - */ - private $debug; - /** - * @var array - */ - private $debugArray = array(); - - /* - * @protected function constructor class - * @param mixed $debug - */ - /** - * @param $debug - */ - public function __construct($debug) - { - $this->debug = $debug; - $this->dirname = basename(dirname(__DIR__)); - } - - /* - * @static function &getInstance - * @param mixed $debug - */ - /** - * @param bool $debug - * @return TDMCreateHelper - */ - public static function &getInstance($debug = false) - { - static $instance = false; - if (!$instance) { - $instance = new self($debug); - } - - return $instance; - } - - /* - * @static function getModule - * @param null - */ - /** - * @return string - */ - public function &getModule() - { - if ($this->module == null) { - $this->initModule(); - } - - return $this->module; - } - - /* - * @static function getConfig - * @param string $name - */ - /** - * @param null $name - * @return null|string - */ - public function getConfig($name = null) - { - if ($this->config == null) { - $this->initConfig(); - } - if (!$name) { - $this->addLog("Getting all config"); - - return $this->config; - } - if (!isset($this->config[$name])) { - $this->addLog("ERROR :: CONFIG '{$name}' does not exist"); - - return null; - } - $this->addLog("Getting config '{$name}' : " . $this->config[$name]); - - return $this->config[$name]; - } - - /* - * @static function setConfig - * @param string $name - * @param mixed $value - */ - /** - * @param null $name - * @param null $value - * @return mixed - */ - public function setConfig($name = null, $value = null) - { - if ($this->config == null) { - $this->initConfig(); - } - $this->config[$name] = $value; - $this->addLog("Setting config '{$name}' : " . $this->config[$name]); - - return $this->config[$name]; - } - - /* - * @static function getHandler - * @param string $name - */ - /** - * @param $name - * @return mixed - */ - public function &getHandler($name) - { - if (!isset($this->handler[$name . '_handler'])) { - $this->initHandler($name); - } - $this->addLog("Getting handler '{$name}'"); - - return $this->handler[$name . '_handler']; - } - - /* - * @static function initModule - * @param null - */ - public function initModule() - { - global $xoopsModule; - if (isset($xoopsModule) && is_object($xoopsModule) && $xoopsModule->getVar('dirname') == $this->dirname) { - $this->module = $xoopsModule; - } else { - $hModule = xoops_gethandler('module'); - $this->module = $hModule->getByDirname($this->dirname); - } - $this->addLog('INIT MODULE'); - } - - /* - * @static function initConfig - * @param null - */ - public function initConfig() - { - $this->addLog('INIT CONFIG'); - $hModConfig = xoops_gethandler('config'); - $this->config = $hModConfig->getConfigsByCat(0, $this->getModule()->getVar('mid')); - } - - /* - * @static function initHandler - * @param string $name - */ - /** - * @param $name - */ - public function initHandler($name) - { - $this->addLog('INIT ' . $name . ' HANDLER'); - $this->handler[$name . '_handler'] = xoops_getModuleHandler($name, $this->dirname); - } - - /* - * @static function addLog - * @param string $log - */ - /** - * @param $log - */ - public function addLog($log) - { - if ($this->debug && is_object($GLOBALS['xoopsLogger'])) { - $GLOBALS['xoopsLogger']->addExtra($this->module->name(), $log); - } - } -} Deleted: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/TDMCreateSession.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/TDMCreateSession.php 2015-06-09 02:59:11 UTC (rev 13084) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/TDMCreateSession.php 2015-06-09 17:53:59 UTC (rev 13085) @@ -1,114 +0,0 @@ -<?php -/* - You may not change or alter any portion of this comment or credits - of supporting developers from this source code or any supporting source code - which is considered copyrighted (c) material of the original comment or credit authors. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - */ -/** - * TDMCreate class - * - * @copyright The XUUPS Project http://sourceforge.net/projects/xuups/ - * @license http://www.fsf.org/copyleft/gpl.html GNU public license - * @package TDMCreate - * @since 1.0 - * @author trabis <lus...@gm...> - * @author Harry Fuecks (PHP Anthology Volume II) - * @version $Id: 1.91 session.php 12453 2014-03-28 18:34:46Z timgno $ - */ -defined('XOOPS_ROOT_PATH') or die('Restricted access'); - -/** - * Class TDMCreateSession - */ -class TDMCreateSession -{ - /** - * Session constructor<br /> - * Starts the session with session_start() - * <strong>Note:</strong> that if the session has already started, - * session_start() does nothing - */ - public function __construct() - { - if (!isset($_SESSION)) { - session_start(); - } - } - - /* - * @static function &getInstance - * @param null - */ - /** - * @return TDMCreateSession - */ - public static function &getInstance() - { - static $_sess = false; - if (!isset($_sess)) { - $_sess = new self(); - } - - return $_sess; - } - - /** - * Sets a session variable - * - * @param string $name name of variable - * @param mixed $value value of variable - * - * @return void - * @access public - */ - public function setSession($name, $value) - { - $_SESSION[$name] = $value; - } - - /** - * Fetches a session variable - * - * @param string $name name of variable - * - * @return mixed value of session variable - * @access public - */ - public function getSession($name) - { - if (isset($_SESSION[$name])) { - return $_SESSION[$name]; - } else { - return false; - } - } - - /** - * Deletes a session variable - * - * @param string $name name of variable - * - * @return void - * @access public - */ - public function deleteSession($name) - { - unset($_SESSION[$name]); - } - - /** - * Destroys the whole session - * - * @return void - * @access public - */ - public function destroySession() - { - $_SESSION = array(); - session_destroy(); - } -} Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/autoload.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/autoload.php 2015-06-09 02:59:11 UTC (rev 13084) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/autoload.php 2015-06-09 17:53:59 UTC (rev 13085) @@ -43,11 +43,11 @@ foreach(new RecursiveIteratorIterator($directories) as $file) { if ($file->getFilename() == $classFilename) { $fullPath = $file->getRealPath(); - $pathCache[$class] = $fullPath; - require_once $fullPath; + $pathCache[$class] = $fullPath; + require_once $fullPath; break; } - } + } } $serialized_paths = serialize($pathCache); Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/fields.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/fields.php 2015-06-09 02:59:11 UTC (rev 13084) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/fields.php 2015-06-09 17:53:59 UTC (rev 13085) @@ -46,6 +46,7 @@ public function __construct() { $this->tdmcreate = TDMCreateHelper::getInstance(); + $this->tdmcreate = TDMCreateHelper::getInstance(); $this->initVar('field_id', XOBJ_DTYPE_INT); $this->initVar('field_mid', XOBJ_DTYPE_INT); $this->initVar('field_tid', XOBJ_DTYPE_INT); @@ -59,10 +60,13 @@ $this->initVar('field_key', XOBJ_DTYPE_TXTBOX); $this->initVar('field_element', XOBJ_DTYPE_TXTBOX); $this->initVar('field_parent', XOBJ_DTYPE_INT); + $this->initVar('field_admin', XOBJ_DTYPE_INT); $this->initVar('field_inlist', XOBJ_DTYPE_INT); $this->initVar('field_inform', XOBJ_DTYPE_INT); - $this->initVar('field_admin', XOBJ_DTYPE_INT); $this->initVar('field_user', XOBJ_DTYPE_INT); + $this->initVar('field_thead', XOBJ_DTYPE_INT); + $this->initVar('field_tbody', XOBJ_DTYPE_INT); + $this->initVar('field_tfoot', XOBJ_DTYPE_INT); $this->initVar('field_block', XOBJ_DTYPE_INT); $this->initVar('field_main', XOBJ_DTYPE_INT); $this->initVar('field_search', XOBJ_DTYPE_INT); @@ -242,7 +246,12 @@ $checkFieldParent = new TDMCreateFormRadio('', 'field_parent', $field_parent); $checkFieldParent->addOption($i, _AM_TDMCREATE_FIELD_PARENT ); $parametersTray->addElement($checkFieldParent);*/ - + + $field_admin = 0; + $checkFieldAdmin = new XoopsFormCheckBox(' ', 'field_admin[' . $i . ']', $field_admin); + $checkFieldAdmin->addOption(1, _AM_TDMCREATE_FIELD_ADMIN); + $parametersTray->addElement($checkFieldAdmin); + $field_inlist = 0; $checkFieldInList = new XoopsFormCheckBox(' ', 'field_inlist[' . $i . ']', $field_inlist); $checkFieldInList->addOption(1, _AM_TDMCREATE_FIELD_INLIST); @@ -253,15 +262,25 @@ $checkFieldInForm->addOption(1, _AM_TDMCREATE_FIELD_INFORM); $parametersTray->addElement($checkFieldInForm); - $field_admin = 0; - $checkFieldAdmin = new XoopsFormCheckBox(' ', 'field_admin[' . $i . ']', $field_admin); - $checkFieldAdmin->addOption(1, _AM_TDMCREATE_FIELD_ADMIN); - $parametersTray->addElement($checkFieldAdmin); - $field_user = 0; $checkFieldUser = new XoopsFormCheckBox(' ', 'field_user[' . $i . ']', $field_user); $checkFieldUser->addOption(1, _AM_TDMCREATE_FIELD_USER); $parametersTray->addElement($checkFieldUser); + + $field_thead = 0; + $checkFieldThead = new XoopsFormCheckBox(' ', 'field_thead[' . $i . ']', $field_thead); + $checkFieldThead->addOption(1, _AM_TDMCREATE_FIELD_THEAD); + $parametersTray->addElement($checkFieldThead); + + $field_tbody = 0; + $checkFieldTbody = new XoopsFormCheckBox(' ', 'field_tbody[' . $i . ']', $field_tbody); + $checkFieldTbody->addOption(1, _AM_TDMCREATE_FIELD_TBODY); + $parametersTray->addElement($checkFieldTbody); + + $field_tfoot = 0; + $checkFieldTfoot = new XoopsFormCheckBox(' ', 'field_tfoot[' . $i . ']', $field_tfoot); + $checkFieldTfoot->addOption(1, _AM_TDMCREATE_FIELD_TFOOT); + $parametersTray->addElement($checkFieldTfoot); $field_block = 0; $checkFieldBlock = new XoopsFormCheckBox('', 'field_block[' . $i . ']', $field_block); @@ -282,6 +301,7 @@ $checkFieldRequired = new XoopsFormCheckBox(' ', 'field_required[' . $i . ']', $field_required); $checkFieldRequired->addOption(1, _AM_TDMCREATE_FIELD_REQUIRED); $parametersTray->addElement($checkFieldRequired); + // $form->addElement(new TDMCreateFormLabel('<td><div class="portlet"><div class="portlet-header">' . _AM_TDMCREATE_FIELD_PARAMETERS_LIST . '</div><div class="portlet-content">' . $parametersTray->render() . '</div></div></td></tr>')); } } @@ -376,28 +396,36 @@ $checkFieldParent = new XoopsFormCheckBox(' ', 'field_parent[' . $id . ']', $field->getVar('field_parent')); $checkFieldParent->addOption(1, _AM_TDMCREATE_FIELD_PARENT); $parametersTray->addElement($checkFieldParent); - /*$field_parent = ($field->getVar('field_parent') == 1) ? $id : 1; - $checkFieldParent = new TDMCreateFormRadio('', 'field_parent', $field_parent); - $checkFieldParent->addOption($id, _AM_TDMCREATE_FIELD_PARENT ); - $parametersTray->addElement($checkFieldParent);*/ - + + $checkFieldAdmin = new XoopsFormCheckBox(' ', 'field_admin[' . $id . ']', $field->getVar('field_admin')); + $checkFieldAdmin->addOption(1, _AM_TDMCREATE_FIELD_ADMIN); + $parametersTray->addElement($checkFieldAdmin); + $checkFieldInList = new XoopsFormCheckBox(' ', 'field_inlist[' . $id . ']', $field->getVar('field_inlist')); $checkFieldInList->addOption(1, _AM_TDMCREATE_FIELD_INLIST); $parametersTray->addElement($checkFieldInList); $checkFieldInForm = new XoopsFormCheckBox(' ', 'field_inform[' . $id . ']', $field->getVar('field_inform')); $checkFieldInForm->addOption(1, _AM_TDMCREATE_FIELD_INFORM); - $parametersTray->addElement($checkFieldInForm); + $parametersTray->addElement($checkFieldInForm); - $checkFieldAdmin = new XoopsFormCheckBox(' ', 'field_admin[' . $id . ']', $field->getVar('field_admin')); - $checkFieldAdmin->addOption(1, _AM_TDMCREATE_FIELD_ADMIN); - $parametersTray->addElement($checkFieldAdmin); - $checkFieldUser = new XoopsFormCheckBox(' ', 'field_user[' . $id . ']', $field->getVar('field_user')); $checkFieldUser->addOption(1, _AM_TDMCREATE_FIELD_USER); $parametersTray->addElement($checkFieldUser); - - $checkFieldBlock = new XoopsFormCheckBox('', 'field_block[' . $id . ']', $field->getVar('field_block')); + + $checkFieldThead = new XoopsFormCheckBox(' ', 'field_thead[' . $id . ']', $field->getVar('field_thead')); + $checkFieldThead->addOption(1, _AM_TDMCREATE_FIELD_THEAD); + $parametersTray->addElement($checkFieldThead); + + $checkFieldTbody = new XoopsFormCheckBox(' ', 'field_tbody[' . $id . ']', $field->getVar('field_tbody')); + $checkFieldTbody->addOption(1, _AM_TDMCREATE_FIELD_TBODY); + $parametersTray->addElement($checkFieldTbody); + + $checkFieldTfoot = new XoopsFormCheckBox(' ', 'field_tfoot[' . $id . ']', $field->getVar('field_tfoot')); + $checkFieldTfoot->addOption(1, _AM_TDMCREATE_FIELD_TFOOT); + $parametersTray->addElement($checkFieldTfoot); + + $checkFieldBlock = new XoopsFormCheckBox('', 'field_block[' . $id . ']', $field->getVar('field_block')); $checkFieldBlock->addOption(1, _AM_TDMCREATE_FIELD_BLOCK); $parametersTray->addElement($checkFieldBlock); @@ -591,7 +619,7 @@ /** * Get All Fields By Module & Table Id */ - public function getAllFieldsByModuleAndTableId($modId, $tabId, $start = 0, $limit = 0, $sort = 'field_id ASC, field_name', $order = 'ASC') + public function getAllFieldsByModuleAndTableId($modId, $tabId, $start = 0, $limit = 0, $sort = 'field_order ASC, field_id, field_name', $order = 'ASC') { $criteria = new CriteriaCompo(); $criteria->add(new Criteria('field_mid', $modId)); Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateArchitecture.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateArchitecture.php 2015-06-09 02:59:11 UTC (rev 13084) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateArchitecture.php 2015-06-09 17:53:59 UTC (rev 13085) @@ -101,7 +101,7 @@ // Creation of "module" folder in the Directory repository $this->structure->makeDir($uploadPath . '/' . $this->structure->getModuleName()); // Copied of index.html file in "root module" folder - $this->structure->copyFile('', $indexFile, 'index.html'); + //$this->structure->copyFile('', $indexFile, 'index.html'); if (1 == $module->getVar('mod_admin')) { // Creation of "admin" folder and index.html file $this->structure->makeDirAndCopyFile('admin', $indexFile, 'index.html'); @@ -183,19 +183,20 @@ $this->structure->makeDirAndCopyFile('templates/admin', $indexFile, 'index.html'); } if ($table->getVar('table_name') != null) { - if (1 == $module->getVar('mod_blocks')) { + if ((1 == $module->getVar('mod_blocks')) && (1 == $table->getVar('table_blocks'))) { // Creation of "templates/blocks" folder and index.html file $this->structure->makeDirAndCopyFile('templates/blocks', $indexFile, 'index.html'); } // Creation of "sql" folder and index.html file $this->structure->makeDirAndCopyFile('sql', $indexFile, 'index.html'); - if (1 == $table->getVar('table_notifications')) { - // Creation of "language/english/mail_template" folder and index.html file - $this->structure->makeDirAndCopyFile('language/english/mail_template', $indexFile, 'index.html'); + if ((1 == $module->getVar('mod_notifications')) && (1 == $table->getVar('table_notifications'))) { if ($language != 'english') { // Creation of "language/local_language/mail_template" folder and index.html file $this->structure->makeDirAndCopyFile('language/' . $language . '/mail_template', $indexFile, 'index.html'); - } + } else { + // Creation of "language/english/mail_template" folder and index.html file + $this->structure->makeDirAndCopyFile('language/english/mail_template', $indexFile, 'index.html'); + } } } } @@ -277,6 +278,10 @@ $userTemplatesPages = TemplatesUserPages::getInstance(); $userTemplatesPages->write($module, $table); $ret[] = $userTemplatesPages->renderFile($moduleDirname . '_' . $tableName . '.tpl'); + // User List Templates File + $userTemplatesPagesList = TemplatesUserPagesList::getInstance(); + $userTemplatesPagesList->write($module, $table); + $ret[] = $userTemplatesPagesList->renderFile($moduleDirname . '_' . $tableName . '_list' . '.tpl'); } } // Language Modinfo File @@ -331,7 +336,7 @@ $ret[] = $classHelper->render(); // Include Functions File $includeFunctions = IncludeFunctions::getInstance(); - $includeFunctions->write($module, 'functions.php'); + $includeFunctions->write($module, $table, 'functions.php'); $ret[] = $includeFunctions->render(); // Creation of blocks language file if ($table->getVar('table_name') != null) { @@ -417,7 +422,7 @@ if (1 == $module->getVar('mod_admin')) { // Templates Index File $userTemplatesIndex = TemplatesUserIndex::getInstance(); - $userTemplatesIndex->write($module, $moduleDirname . '_index.tpl'); + $userTemplatesIndex->write($module, $table, $moduleDirname . '_index.tpl'); $ret[] = $userTemplatesIndex->render(); // Templates Footer File $userTemplatesFooter = TemplatesUserFooter::getInstance(); @@ -425,7 +430,7 @@ $ret[] = $userTemplatesFooter->render(); // Templates Header File $userTemplatesHeader = TemplatesUserHeader::getInstance(); - $userTemplatesHeader->write($module, $tables, $moduleDirname . '_header.tpl'); + $userTemplatesHeader->write($module, $table, $tables, $moduleDirname . '_header.tpl'); $ret[] = $userTemplatesHeader->render(); } // Creation of user files Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateFile.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateFile.php 2015-06-09 02:59:11 UTC (rev 13084) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateFile.php 2015-06-09 17:53:59 UTC (rev 13085) @@ -511,7 +511,7 @@ /** * {$name} module for xoops * - * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @copyright The XOOPS Project (http://xoops.org) * @license {$license} * @package {$dirname} * @since {$since} Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateHtmlSmartyCodes.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateHtmlSmartyCodes.php 2015-06-09 02:59:11 UTC (rev 13084) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateHtmlSmartyCodes.php 2015-06-09 17:53:59 UTC (rev 13085) @@ -16,7 +16,7 @@ * @package tdmcreate * @since 2.5.0 * @author Txmod Xoops http://www.txmodxoops.org - * @version $Id: htmlsmartycodes.php 12258 2014-01-02 09:33:29Z timgno $ + * @version $Id: TDMCreateHtmlSmartyCodes.php 12258 2014-01-02 09:33:29Z timgno $ */ defined('XOOPS_ROOT_PATH') or die('Restricted access'); @@ -380,7 +380,26 @@ return $ret; } + + /* + * @public function getSmartyIncludeFileList + * @param string $name + */ + /** + * @param $moduleDirname + * @param $tableName + * @param $tableFieldName + * @return string + */ + public function getSmartyIncludeFileList($moduleDirname, $tableName, $tableFieldName) + { + $ret = <<<EOT + <{include file='db:{$moduleDirname}_{$tableName}_list.tpl' {$tableFieldName}=\${$tableFieldName}[i]}> +EOT; + return $ret; + } + /* * @public function getSmartyConditions * @param string $condition Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateTableFields.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateTableFields.php 2015-06-09 02:59:11 UTC (rev 13084) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateTableFields.php 2015-06-09 17:53:59 UTC (rev 13085) @@ -33,16 +33,32 @@ $this->tdmcreate = TDMCreateHelper::getInstance(); } + /* + * @static function &getInstance + * + * @return TDMCreateFields + */ + public static function &getInstance() + { + static $instance = false; + if (!$instance) { + $instance = new self(); + } + + return $instance; + } + /** * @public function getTableTables * @param $mId * @return mixed */ - public function getTableTables($mId) + public function getTableTables($mId, $sort = 'table_id ASC, table_name', $order = 'ASC') { $criteria = new CriteriaCompo(); $criteria->add(new Criteria('table_mid', $mId)); // $mId = module Id - $criteria->setSort('table_order'); + $criteria->setSort($sort); + $criteria->setOrder($order); $tables = $this->tdmcreate->getHandler('tables')->getObjects($criteria); unset($criteria); @@ -55,15 +71,41 @@ * @param $tId * @return mixed */ - public function getTableFields($mId, $tId) + public function getTableFields($mId, $tId, $sort = 'field_id ASC, field_name', $order = 'ASC') { $criteria = new CriteriaCompo(); $criteria->add(new Criteria('field_mid', $mId)); // $mId = module Id $criteria->add(new Criteria('field_tid', $tId)); // $tId = table Id - $criteria->setSort('field_order'); + $criteria->setSort($sort); + $criteria->setOrder($order); $fields = $this->tdmcreate->getHandler('fields')->getObjects($criteria); unset($criteria); return $fields; } + + /** + * @public function getTableFieldElements + * @param $mId + * @param $tId + * @return mixed + */ + public function getTableFieldElements($mId = null, $tId = null, $sort = 'fieldelement_id ASC, fieldelement_name', $order = 'ASC') + { + $criteria = new CriteriaCompo(); + if($mId != null) { + $criteria->add(new Criteria('fieldelement_mid', $mId)); // $mId = module Id + $criteria->setSort($sort); + $criteria->setOrder($order); + } + if($tId != null) { + $criteria->add(new Criteria('fieldelement_tid', $tId)); // $tId = table Id + $criteria->setSort($sort); + $criteria->setOrder($order); + } + $fieldElements = $this->tdmcreate->getHandler('fieldelements')->getObjects($criteria); + unset($criteria); + + return $fieldElements; + } } Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/admin/AdminMenu.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/admin/AdminMenu.php 2015-06-09 02:59:11 UTC (rev 13084) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/admin/AdminMenu.php 2015-06-09 17:53:59 UTC (rev 13085) @@ -162,7 +162,7 @@ { $module = $this->getModule(); $table = $this->getTable(); - $tables = $this->getTables(); + //$tables = $this->getTables(); $filename = $this->getFileName(); $moduleDirname = $module->getVar('mod_dirname'); $language = $this->getLanguage($moduleDirname, 'MI', 'ADMENU'); @@ -170,7 +170,8 @@ $content = $this->getHeaderFilesComments($module, $filename); $content .= $this->getAdminMenuHeader(); $content .= $this->getAdminMenuDashboard($language, $menu); - foreach (array_keys($tables) as $t) { + $tables = $this->getTableTables($module->getVar('mod_id'), 'table_order ASC, table_name'); + foreach (array_keys($tables) as $t) { $tablePermissions = $tables[$t]->getVar('table_permissions'); if (1 == $tables[$t]->getVar('table_admin')) { ++$menu; @@ -185,7 +186,7 @@ EOT; } } - if (is_object($table) && 1 == $table->getVar('table_permissions')) { + if (1 == $table->getVar('table_permissions')) { ++$menu; $content .= <<<EOT \$adminmenu[\$i]['title'] = {$language}{$menu}; Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/admin/AdminObjects.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/admin/AdminObjects.php 2015-06-09 02:59:11 UTC (rev 13084) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/admin/AdminObjects.php 2015-06-09 17:53:59 UTC (rev 13085) @@ -101,8 +101,9 @@ \${$tableName}Obj->setVar('{$fieldName}', formatUrl(\$_REQUEST['{$fieldName}']));\n // Set Var {$fieldName} include_once XOOPS_ROOT_PATH.'/class/uploader.php'; - \$uploader = new XoopsMediaUploader({$stuModuleDirname}_UPLOAD_FILES_PATH . '/{$tableName}', \${$moduleDirname}->getConfig('mimetypes'), - \${$moduleDirname}->getConfig('maxsize'), null, null); + \$uploader = new XoopsMediaUploader({$stuModuleDirname}_UPLOAD_FILES_PATH . '/{$tableName}', + \${$moduleDirname}->getConfig('mimetypes'), + \${$moduleDirname}->getConfig('maxsize'), null, null); if (\$uploader->fetchMedia(\$_POST['xoops_upload_file'][0])) { \$uploader->fetchMedia(\$_POST['xoops_upload_file'][0]); if (!\$uploader->upload()) { @@ -132,9 +133,9 @@ \$uploaddir = XOOPS_ROOT_PATH . '/Frameworks/moduleclasses/icons/32'; \$uploader = new XoopsMediaUploader(\$uploaddir, \${$moduleDirname}->getConfig('mimetypes'), \${$moduleDirname}->getConfig('maxsize'), null, null); - if (\$uploader->fetchMedia(\$_POST['xoops_upload_file'][1])) { + if (\$uploader->fetchMedia(\$_POST['xoops_upload_file'][0])) { //\$uploader->setPrefix('{$fieldName}_'); - //\$uploader->fetchMedia(\$_POST['xoops_upload_file'][1]); + //\$uploader->fetchMedia(\$_POST['xoops_upload_file'][0]); if (!\$uploader->upload()) { \$errors = \$uploader->getErrors(); redirect_header('javascript:history.go(-1)', 3, \$errors); @@ -161,14 +162,14 @@ $ret = <<<EOT // Set Var {$fieldName} include_once XOOPS_ROOT_PATH.'/class/uploader.php'; - \$uploaddir = {$stuModuleDirname}_UPLOAD_PATH.'/images/{$tableName}'; - \$uploader = new XoopsMediaUploader(\$uploaddir, \${$moduleDirname}->getConfig('mimetypes'), - \${$moduleDirname}->getConfig('maxsize'), null, null); - if (\$uploader->fetchMedia(\$_POST['xoops_upload_file'][2])) { + \$uploader = new XoopsMediaUploader({$stuModuleDirname}_UPLOAD_IMAGE_PATH.'/{$tableName}', + \${$moduleDirname}->getConfig('mimetypes'), + \${$moduleDirname}->getConfig('maxsize'), null, null); + if (\$uploader->fetchMedia(\$_POST['xoops_upload_file'][0])) { \$extension = preg_replace( '/^.+\.([^.]+)$/sU' , '' , \$_FILES['attachedfile']['name']); \$imgName = str_replace(' ', '', \$_POST['{$fieldMain}']).'.'.\$extension; \$uploader->setPrefix(\$imgName); - \$uploader->fetchMedia(\$_POST['xoops_upload_file'][2]); + \$uploader->fetchMedia(\$_POST['xoops_upload_file'][0]); if (!\$uploader->upload()) { \$errors = \$uploader->getErrors(); redirect_header('javascript:history.go(-1)', 3, \$errors); @@ -195,12 +196,12 @@ $ret = <<<EOT // Set Var {$fieldName} include_once XOOPS_ROOT_PATH.'/class/uploader.php'; - \$uploaddir = {$stuModuleDirname}_UPLOAD_PATH.'/files/{$tableName}'; - \$uploader = new XoopsMediaUploader(\$uploaddir, \${$moduleDirname}->getConfig('mimetypes'), - \${$moduleDirname}->getConfig('maxsize'), null, null); - if (\$uploader->fetchMedia(\$_POST['xoops_upload_file'][3])) { + \$uploader = new XoopsMediaUploader({$stuModuleDirname}_UPLOAD_FILES_PATH.'/{$tableName}', + \${$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'][3]); + //\$uploader->fetchMedia(\$_POST['xoops_upload_file'][0]); if (!\$uploader->upload()) { \$errors = \$uploader->getErrors(); redirect_header('javascript:history.go(-1)', 3, \$errors); Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/admin/AdminPages.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/admin/AdminPages.php 2015-06-09 02:59:11 UTC (rev 13084) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/admin/AdminPages.php 2015-06-09 17:53:59 UTC (rev 13085) @@ -221,7 +221,7 @@ case 6: $ret .= $this->adminobjects->getCheckBoxOrRadioYNSetVar($tableName, $fieldName); break; - case 11: + case 10: $ret .= $this->adminobjects->getImageListSetVar($moduleDirname, $tableName, $fieldName); break; case 12: Modifie... [truncated message content] |
From: <txm...@us...> - 2015-06-10 16:08:37
|
Revision: 13086 http://sourceforge.net/p/xoops/svn/13086 Author: txmodxoops Date: 2015-06-10 16:08:35 +0000 (Wed, 10 Jun 2015) Log Message: ----------- Fix added more files Modified Paths: -------------- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/fieldelements.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/fields.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateArchitecture.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/include/IncludeFunctions.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/user/UserIndex.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/user/UserXoopsVersion.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/logoGenerator.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/modules.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/include/common.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/language/english/admin.php Added Paths: ----------- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/user/TemplatesUserDisqusComments.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/user/TemplatesUserFacebookComments.php Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/fieldelements.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/fieldelements.php 2015-06-09 17:53:59 UTC (rev 13085) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/fieldelements.php 2015-06-10 16:08:35 UTC (rev 13086) @@ -98,4 +98,58 @@ { parent::__construct($db, 'tdmcreate_fieldelements', 'tdmcreatefieldelements', 'fieldelement_id', 'fieldelement_name'); } + + /** + * Get Count Fields + */ + public function getCountFieldElements($start = 0, $limit = 0, $sort = 'fieldelement_id ASC, fieldelement_name', $order = 'ASC') + { + $criteria = new CriteriaCompo(); + $criteria->setSort($sort); + $criteria->setOrder($order); + $criteria->setStart($start); + $criteria->setLimit($limit); + return parent::getCount($criteria); + } + + /** + * Get Objects Fields + */ + public function getObjectsFieldElements($start = 0, $limit = 0, $sort = 'fieldelement_id ASC, fieldelement_name', $order = 'ASC') + { + $criteria = new CriteriaCompo(); + $criteria->setSort($sort); + $criteria->setOrder($order); + $criteria->setStart($start); + $criteria->setLimit($limit); + return parent::getObjects($criteria); + } + + /** + * Get All Fields + */ + public function getAllFieldElements($start = 0, $limit = 0, $sort = 'fieldelement_id ASC, fieldelement_name', $order = 'ASC') + { + $criteria = new CriteriaCompo(); + $criteria->setSort($sort); + $criteria->setOrder($order); + $criteria->setStart($start); + $criteria->setLimit($limit); + return parent::getAll($criteria); + } + + /** + * Get All Fields By Module & Table Id + */ + public function getAllFieldElementsByModuleAndTableId($modId, $tabId, $start = 0, $limit = 0, $sort = 'fieldelement_id ASC, fieldelement_name', $order = 'ASC') + { + $criteria = new CriteriaCompo(); + $criteria->add(new Criteria('fieldelement_mid', $modId)); + $criteria->add(new Criteria('fieldelement_tid', $tabId)); + $criteria->setSort($sort); + $criteria->setOrder($order); + $criteria->setStart($start); + $criteria->setLimit($limit); + return parent::getAll($criteria); + } } Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/fields.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/fields.php 2015-06-09 17:53:59 UTC (rev 13085) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/fields.php 2015-06-10 16:08:35 UTC (rev 13086) @@ -35,6 +35,24 @@ * @var mixed */ private $tdmcreate; + + /** + * Options + */ + public $options = array( + 'parent', + 'admin', + 'inlist', + 'inform', + 'user', + 'thead', + 'tbody', + 'tfoot', + 'block', + 'main', + 'search', + 'required' + ); /* * @public function constructor class @@ -46,7 +64,6 @@ public function __construct() { $this->tdmcreate = TDMCreateHelper::getInstance(); - $this->tdmcreate = TDMCreateHelper::getInstance(); $this->initVar('field_id', XOBJ_DTYPE_INT); $this->initVar('field_mid', XOBJ_DTYPE_INT); $this->initVar('field_tid', XOBJ_DTYPE_INT); @@ -120,7 +137,7 @@ $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('<table cellspacing="1" class="outer width100">')); $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">')); @@ -156,8 +173,8 @@ $fieldsForm = TDMCreateFields::getInstance(); $form = $fieldsForm->getHeaderForm($action); // Get handler tables - $table_obj = $this->tdmcreate->getHandler('tables'); // Changed by goffy - $tableAutoincrement = $table_obj->get($fieldTid)->getVar('table_autoincrement'); // Added by goffy + $tableObj = $this->tdmcreate->getHandler('tables'); // Changed by goffy + $tableAutoincrement = $tableObj->get($fieldTid)->getVar('table_autoincrement'); // Added by goffy // Loop for fields number $class = 'even'; for ($i = 1; $i <= $fieldNumb; ++$i) { @@ -242,11 +259,7 @@ $checkFieldParent = new XoopsFormCheckBox(' ', 'field_parent[' . $i . ']', $field_parent); $checkFieldParent->addOption(1, _AM_TDMCREATE_FIELD_PARENT); $parametersTray->addElement($checkFieldParent); - /*$field_parent = (1 == $tableAutoincrement) ? 2 : 1; - $checkFieldParent = new TDMCreateFormRadio('', 'field_parent', $field_parent); - $checkFieldParent->addOption($i, _AM_TDMCREATE_FIELD_PARENT ); - $parametersTray->addElement($checkFieldParent);*/ - + $field_admin = 0; $checkFieldAdmin = new XoopsFormCheckBox(' ', 'field_admin[' . $i . ']', $field_admin); $checkFieldAdmin->addOption(1, _AM_TDMCREATE_FIELD_ADMIN); @@ -287,11 +300,6 @@ $checkFieldBlock->addOption(1, _AM_TDMCREATE_FIELD_BLOCK); $parametersTray->addElement($checkFieldBlock); - $fieldMain = (1 == $tableAutoincrement) ? 2 : 1; - $checkFieldMain = new TDMCreateFormRadio('', 'field_main', $fieldMain); - $checkFieldMain->addOption($i, _AM_TDMCREATE_FIELD_MAINFIELD); - $parametersTray->addElement($checkFieldMain); - $field_search = 0; $check_field_search = new XoopsFormCheckBox(' ', 'field_search[' . $i . ']', $field_search); $check_field_search->addOption(1, _AM_TDMCREATE_FIELD_SEARCH); @@ -301,6 +309,11 @@ $checkFieldRequired = new XoopsFormCheckBox(' ', 'field_required[' . $i . ']', $field_required); $checkFieldRequired->addOption(1, _AM_TDMCREATE_FIELD_REQUIRED); $parametersTray->addElement($checkFieldRequired); + + $fieldMain = (1 == $tableAutoincrement) ? 2 : 1; + $checkFieldMain = new TDMCreateFormRadio('', 'field_main', $fieldMain); + $checkFieldMain->addOption($i, _AM_TDMCREATE_FIELD_MAIN); + $parametersTray->addElement($checkFieldMain); // $form->addElement(new TDMCreateFormLabel('<td><div class="portlet"><div class="portlet-header">' . _AM_TDMCREATE_FIELD_PARAMETERS_LIST . '</div><div class="portlet-content">' . $parametersTray->render() . '</div></div></td></tr>')); } @@ -392,6 +405,15 @@ $fieldElementsSelect->addOptionArray($this->tdmcreate->getHandler('fieldelements')->getList($criteriaTable)); unset($criteriaElement, $criteriaTable); $parametersTray->addElement($fieldElementsSelect); + + // Options + /*$moduleOption = $this->getOptions(); + $checkbox = new XoopsFormCheckbox(' ', 'fields_option[' . $id . ']', $moduleOption, '<br />'); + $checkbox->setDescription(_AM_TDMCREATE_OPTIONS_DESC); + foreach ($this->options as $option) { + $checkbox->addOption($option, self::getDefinedLanguage('_AM_TDMCREATE_FIELD_' . strtoupper($option))); + } + $parametersTray->addElement($checkbox);*/ $checkFieldParent = new XoopsFormCheckBox(' ', 'field_parent[' . $id . ']', $field->getVar('field_parent')); $checkFieldParent->addOption(1, _AM_TDMCREATE_FIELD_PARENT); @@ -428,19 +450,20 @@ $checkFieldBlock = new XoopsFormCheckBox('', 'field_block[' . $id . ']', $field->getVar('field_block')); $checkFieldBlock->addOption(1, _AM_TDMCREATE_FIELD_BLOCK); $parametersTray->addElement($checkFieldBlock); - - $fieldMain = (1 == $field->getVar('field_main')) ? $id : 1; - $checkFieldMain = new TDMCreateFormRadio('', 'field_main', $fieldMain); - $checkFieldMain->addOption($id, _AM_TDMCREATE_FIELD_MAINFIELD); - $parametersTray->addElement($checkFieldMain); - - $check_field_search = new XoopsFormCheckBox(' ', 'field_search[' . $id . ']', $field->getVar('field_search')); + + $check_field_search = new XoopsFormCheckBox(' ', 'field_search[' . $id . ']', $field->getVar('field_search')); $check_field_search->addOption(1, _AM_TDMCREATE_FIELD_SEARCH); $parametersTray->addElement($check_field_search); $checkFieldRequired = new XoopsFormCheckBox(' ', 'field_required[' . $id . ']', $field->getVar('field_required')); $checkFieldRequired->addOption(1, _AM_TDMCREATE_FIELD_REQUIRED); $parametersTray->addElement($checkFieldRequired); + + $fieldMain = (1 == $field->getVar('field_main')) ? $id : 1; + $checkFieldMain = new TDMCreateFormRadio('', 'field_main', $fieldMain); + $checkFieldMain->addOption($id, _AM_TDMCREATE_FIELD_MAIN); + $parametersTray->addElement($checkFieldMain); + // $form->addElement(new TDMCreateFormLabel('<td><div class="portlet"><div class="portlet-header">' . _AM_TDMCREATE_FIELD_PARAMETERS_LIST . '</div><div class="portlet-content">' . $parametersTray->render() . '</div></div></td></tr>')); } } @@ -504,6 +527,75 @@ return $ret; } + + /** + * Get Options + */ + /** + * @param $key + * + * @return string + */ + public function getOptions() + { + $ret = array(); + // + if ($this->getVar('field_parent') == 1) { + array_push($ret, 'parent'); + } + if ($this->getVar('field_admin') == 1) { + array_push($ret, 'admin'); + } + if ($this->getVar('field_inlist') == 1) { + array_push($ret, 'inlist'); + } + if ($this->getVar('field_inform') == 1) { + array_push($ret, 'inform'); + } + if ($this->getVar('field_user') == 1) { + array_push($ret, 'user'); + } + if ($this->getVar('field_thead') == 1) { + array_push($ret, 'thead'); + } + if ($this->getVar('field_tbody') == 1) { + array_push($ret, 'tbody'); + } + if ($this->getVar('field_tfoot') == 1) { + array_push($ret, 'tfoot'); + } + if ($this->getVar('field_block') == 1) { + array_push($ret, 'block'); + } + if ($this->getVar('field_main') == 1) { + array_push($ret, 'main'); + } + if ($this->getVar('field_search') == 1) { + array_push($ret, 'search'); + } + if ($this->getVar('field_required') == 1) { + array_push($ret, 'required'); + } + + return $ret; + } + + /** + * Get Defined Language + */ + /** + * @param $lang + * + * @return string + */ + private static function getDefinedLanguage($lang) + { + if (defined($lang)) { + return constant($lang); + } + + return $lang; + } } /* Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateArchitecture.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateArchitecture.php 2015-06-09 17:53:59 UTC (rev 13085) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateArchitecture.php 2015-06-10 16:08:35 UTC (rev 13086) @@ -134,12 +134,12 @@ // If file exists if (!file_exists($logoGifFrom)) { // Rename file - $copyFile = TDMC_IMAGE_LOGOS_URL . '/xoopsdevelopmentteam_logo.gif'; + $copyFile = TDMC_IMAGES_LOGOS_URL . '/xoopsdevelopmentteam_logo.gif'; $copyNewFile = $logoGifFrom; copy($copyFile, $copyNewFile); } else { // Copy file - $copyFile = TDMC_IMAGE_LOGOS_URL . '/' . $stlModuleAuthor . '_logo.gif'; + $copyFile = TDMC_IMAGES_LOGOS_URL . '/' . $stlModuleAuthor . '_logo.gif'; $copyNewFile = $logoGifFrom; copy($copyFile, $copyNewFile); } Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/include/IncludeFunctions.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/include/IncludeFunctions.php 2015-06-09 17:53:59 UTC (rev 13085) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/include/IncludeFunctions.php 2015-06-10 16:08:35 UTC (rev 13086) @@ -414,10 +414,10 @@ $moduleDirname = $module->getVar('mod_dirname'); $tableName = $table->getVar('table_name'); $content = $this->getHeaderFilesComments($module, $filename); - $content .= $this->getFunctionBlock($moduleDirname); - if(1 == $table->getVar('table_blocks')) { - $content .= $this->getFunctionCleanVars($moduleDirname); + if(1 == $table->getVar('table_blocks')) { + $content .= $this->getFunctionBlock($moduleDirname); } + $content .= $this->getFunctionCleanVars($moduleDirname); if(1 == $table->getVar('table_permissions')) { $content .= $this->getFunctionGetMyItemIds($moduleDirname, $tableName); } Added: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/user/TemplatesUserDisqusComments.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/user/TemplatesUserDisqusComments.php (rev 0) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/user/TemplatesUserDisqusComments.php 2015-06-10 16:08:35 UTC (rev 13086) @@ -0,0 +1,110 @@ +<?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: TemplatesUserDisqusComments.php 12258 2014-01-02 09:33:29Z timgno $ + */ +defined('XOOPS_ROOT_PATH') or die('Restricted access'); + +/** + * Class TemplatesUserDisqusComments + */ +class TemplatesUserDisqusComments extends TDMCreateFile +{ + /* + * @public function constructor + * @param null + */ + /** + * + */ + public function __construct() + { + parent::__construct(); + $this->tdmcfile = TDMCreateFile::getInstance(); + } + + /* + * @static function &getInstance + * @param null + */ + /** + * @return TemplatesUserDisqusComments + */ + public static function &getInstance() + { + static $instance = false; + if (!$instance) { + $instance = new self(); + } + + return $instance; + } + + /* + * @public function write + * @param string $module + * @param string $filename + */ + /** + * @param $module + * @param $filename + * @return string + */ + public function write($module, $filename) + { + $this->setModule($module); + $this->setFileName($filename); + } + + /* + * @private function getTemplatesCommentCode + * @param null + */ + /** + * @param null + * @return string + */ + private function getTemplatesCommentCode() + { + $ret = <<<EOT +Pleace! Enter here your comments code +EOT; + + return $ret; + } + + /* + * @public function renderFile + * @param string $filename + */ + /** + * @param $filename + * @return bool|string + */ + public function renderFile() + { + $module = $this->getModule(); + $filename = $this->getFileName(); + $moduleDirname = $module->getVar('mod_dirname'); + $content = $this->getTemplatesCommentCode(); + // + $this->tdmcfile->create($moduleDirname, 'templates', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED); + + return $this->tdmcfile->renderFile(); + } +} Added: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/user/TemplatesUserFacebookComments.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/user/TemplatesUserFacebookComments.php (rev 0) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/user/TemplatesUserFacebookComments.php 2015-06-10 16:08:35 UTC (rev 13086) @@ -0,0 +1,110 @@ +<?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: TemplatesUserFacebookComments.php 12258 2014-01-02 09:33:29Z timgno $ + */ +defined('XOOPS_ROOT_PATH') or die('Restricted access'); + +/** + * Class TemplatesUserFacebookComments + */ +class TemplatesUserFacebookComments extends TDMCreateFile +{ + /* + * @public function constructor + * @param null + */ + /** + * + */ + public function __construct() + { + parent::__construct(); + $this->tdmcfile = TDMCreateFile::getInstance(); + } + + /* + * @static function &getInstance + * @param null + */ + /** + * @return TemplatesUserFacebookComments + */ + public static function &getInstance() + { + static $instance = false; + if (!$instance) { + $instance = new self(); + } + + return $instance; + } + + /* + * @public function write + * @param string $module + * @param string $filename + */ + /** + * @param $module + * @param $filename + * @return string + */ + public function write($module, $filename) + { + $this->setModule($module); + $this->setFileName($filename); + } + + /* + * @private function getTemplatesCommentCode + * @param null + */ + /** + * @param null + * @return string + */ + private function getTemplatesCommentCode() + { + $ret = <<<EOT +Pleace! Enter here your comments code +EOT; + + return $ret; + } + + /* + * @public function renderFile + * @param string $filename + */ + /** + * @param $filename + * @return bool|string + */ + public function renderFile() + { + $module = $this->getModule(); + $filename = $this->getFileName(); + $moduleDirname = $module->getVar('mod_dirname'); + $content = $this->getTemplatesCommentCode(); + // + $this->tdmcfile->create($moduleDirname, 'templates', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED); + + return $this->tdmcfile->renderFile(); + } +} Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/user/UserIndex.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/user/UserIndex.php 2015-06-09 17:53:59 UTC (rev 13085) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/user/UserIndex.php 2015-06-10 16:08:35 UTC (rev 13086) @@ -137,11 +137,11 @@ if(in_array(1, $fieldParentId)) { $ret .= <<<EOT \${$tableName}Count = \${$tableName}Handler->getCount{$ucfTableName}(); -// -include_once XOOPS_ROOT_PATH . '/class/tree.php'; -\$mytree = new XoopsObjectTree(\${$tableName}All, '{$fieldId}', '{$fieldParent}'); +// If there are {$tableName} if (\${$tableName}Count > 0) { \${$tableName}All = \${$tableName}Handler->getAll{$ucfTableName}(); + include_once XOOPS_ROOT_PATH . '/class/tree.php'; + \$mytree = new XoopsObjectTree(\${$tableName}All, '{$fieldId}', '{$fieldParent}'); foreach (array_keys(\${$tableName}All) as \${$tableFieldname}) { \${$tableSoleName} = \${$tableName}All[\${$tableFieldname}]->getValues(); Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/user/UserXoopsVersion.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/user/UserXoopsVersion.php 2015-06-09 17:53:59 UTC (rev 13085) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/user/UserXoopsVersion.php 2015-06-10 16:08:35 UTC (rev 13086) @@ -795,11 +795,19 @@ 'default' => 0); \$modversion['config'][] = array( - 'name' => "fbcomments", - 'title' => "{$language}FBCOMMENTS", - 'description' => "{$language}FBCOMMENTS_DESC", + 'name' => "facebook_comments", + 'title' => "{$language}FACEBOOK_COMMENTS", + 'description' => "{$language}FACEBOOK_COMMENTS_DESC", 'formtype' => "yesno", 'valuetype' => "int", + 'default' => 0); + +\$modversion['config'][] = array( + 'name' => "disqus_comments", + 'title' => "{$language}DISQUS_COMMENTS", + 'description' => "{$language}DISQUS_COMMENTS_DESC", + 'formtype' => "yesno", + 'valuetype' => "int", 'default' => 0);\n EOT; Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/logoGenerator.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/logoGenerator.php 2015-06-09 17:53:59 UTC (rev 13085) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/logoGenerator.php 2015-06-10 16:08:35 UTC (rev 13086) @@ -48,7 +48,7 @@ } } } - if (!file_exists($imageBase = TDMC_IMAGE_LOGOS_PATH . "/empty.png") || + if (!file_exists($imageBase = TDMC_IMAGES_LOGOS_PATH . "/empty.png") || !file_exists($font = TDMC_FONTS_PATH . "/VeraBd.ttf") || !file_exists($iconFile = XOOPS_ICONS32_PATH . '/' . basename($logoIcon))) { return false; Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/modules.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/modules.php 2015-06-09 17:53:59 UTC (rev 13085) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/modules.php 2015-06-10 16:08:35 UTC (rev 13086) @@ -415,7 +415,7 @@ } } } - if (!file_exists($imageBase = TDMC_IMAGE_LOGOS_PATH . '/empty.png') || + if (!file_exists($imageBase = TDMC_IMAGES_LOGOS_PATH . '/empty.png') || !file_exists($font = TDMC_FONTS_PATH . '/VeraBd.ttf') || !file_exists($iconFile = XOOPS_ICONS32_PATH . '/' . basename($logoIcon)) ) { Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/include/common.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/include/common.php 2015-06-09 17:53:59 UTC (rev 13085) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/include/common.php 2015-06-10 16:08:35 UTC (rev 13086) @@ -33,8 +33,8 @@ define('TDMC_FONTS_URL', TDMC_URL . '/assets/fonts'); define('TDMC_IMAGE_PATH', TDMC_PATH . '/assets/images'); define('TDMC_IMAGE_URL', TDMC_URL . '/assets/images'); -define('TDMC_IMAGE_LOGOS_PATH', TDMC_PATH . '/assets/images/logos'); -define('TDMC_IMAGE_LOGOS_URL', TDMC_URL . '/assets/images/logos'); +define('TDMC_IMAGES_LOGOS_PATH', TDMC_PATH . '/assets/images/logos'); +define('TDMC_IMAGES_LOGOS_URL', TDMC_URL . '/assets/images/logos'); define('TDMC_ICONS_PATH', TDMC_PATH . '/assets/icons'); define('TDMC_ICONS_URL', TDMC_URL . '/assets/icons'); // Uploads Directories Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/language/english/admin.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/language/english/admin.php 2015-06-09 17:53:59 UTC (rev 13085) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/language/english/admin.php 2015-06-10 16:08:35 UTC (rev 13086) @@ -248,7 +248,7 @@ define('_AM_TDMCREATE_FIELD_ADMIN', "Admin: In Files"); define('_AM_TDMCREATE_FIELD_USER', "User: In Files"); define('_AM_TDMCREATE_FIELD_BLOCK', "Block: In Files"); -define('_AM_TDMCREATE_FIELD_MAINFIELD', "Table: Main Field"); +define('_AM_TDMCREATE_FIELD_MAIN', "Table: Main Field"); define('_AM_TDMCREATE_FIELD_SEARCH', "Search: Index"); define('_AM_TDMCREATE_FIELD_REQUIRED', "Field: Required"); define('_AM_TDMCREATE_ADMIN_SUBMIT', "Send"); |
From: <txm...@us...> - 2015-06-12 21:33:11
|
Revision: 13087 http://sourceforge.net/p/xoops/svn/13087 Author: txmodxoops Date: 2015-06-12 21:33:08 +0000 (Fri, 12 Jun 2015) Log Message: ----------- Added morefiles.php and more for extra custom files Updated Modified Paths: -------------- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/menu.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/fieldattributes.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/fields.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateArchitecture.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/admin/AdminPages.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/classes/ClassFiles.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/classes/ClassFormElements.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/language/LanguageAdmin.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/admin/TemplatesAdminPages.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/modules.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/tables.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/language/english/admin.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/language/english/modinfo.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/sql/mysql.sql XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/xoops_version.php Added Paths: ----------- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/morefiles.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/assets/icons/32/files.png XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/user/TemplatesUserMoreFiles.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/morefiles.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/templates/admin/tdmcreate_morefiles.tpl Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/menu.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/menu.php 2015-06-10 16:08:35 UTC (rev 13086) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/menu.php 2015-06-12 21:33:08 UTC (rev 13087) @@ -45,10 +45,14 @@ $adminmenu[$i]['icon'] = 'assets/icons/32/fields.png'; $i++; $adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU6; +$adminmenu[$i]['link'] = 'admin/morefiles.php'; +$adminmenu[$i]['icon'] = 'assets/icons/32/files.png'; +$i++; +$adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU7; $adminmenu[$i]['link'] = 'admin/building.php'; $adminmenu[$i]['icon'] = 'assets/icons/32/builder.png'; $i++; -$adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU7; +$adminmenu[$i]['title'] = _MI_TDMCREATE_ABOUT; $adminmenu[$i]['link'] = 'admin/about.php'; $adminmenu[$i]['icon'] = $sysPathIcon32 . '/about.png'; unset($i); Added: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/morefiles.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/morefiles.php (rev 0) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/morefiles.php 2015-06-12 21:33:08 UTC (rev 13087) @@ -0,0 +1,140 @@ +<?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 morefiles.php 11297 2013-03-24 10:58:10Z timgno $ + */ +include __DIR__ . '/header.php'; +// Recovered value of argument op in the URL $ +$op = XoopsRequest::getString('op', 'list'); +// +$fileId = XoopsRequest::getInt('file_id'); +// +switch ($op) { + case 'list': + default: + $start = XoopsRequest::getInt('start', 0); + $limit = XoopsRequest::getInt('limit', $tdmcreate->getConfig('morefiles_adminpager')); + // Define main template + $templateMain = 'tdmcreate_morefiles.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('morefiles.php')); + $adminMenu->addItemButton(_AM_TDMCREATE_ADD_MORE_FILE, 'morefiles.php?op=new', 'add'); + $GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton()); + $GLOBALS['xoopsTpl']->assign('tdmc_url', TDMC_URL); + $GLOBALS['xoopsTpl']->assign('tdmc_upload_imgfile_url', TDMC_UPLOAD_IMGMOD_URL); + $GLOBALS['xoopsTpl']->assign('modPathIcon16', $modPathIcon16); + $GLOBALS['xoopsTpl']->assign('sysPathIcon32', $sysPathIcon32); + $modulesCount = $tdmcreate->getHandler('modules')->getCountModules(); + // Redirect if there aren't modules + if (0 == $modulesCount) { + redirect_header('modules.php?op=new', 2, _AM_TDMCREATE_NOT_MODULES); + } + $morefilesCount = $tdmcreate->getHandler('morefiles')->getCountMoreFiles(); + $morefilesAll = $tdmcreate->getHandler('morefiles')->getAllMoreFiles($start, $limit); + // Display morefiles list + if ($morefilesCount > 0) { + foreach (array_keys($morefilesAll) as $i) { + $files = $morefilesAll[$i]->getValues(); + $GLOBALS['xoopsTpl']->append('files_list', $files); + unset($files); + } + if ($morefilesCount > $limit) { + include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; + $pagenav = new XoopsPageNav($morefilesCount, $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 + $templateMain = 'tdmcreate_morefiles.tpl'; + $GLOBALS['xoTheme']->addScript('modules/tdmcreate/assets/js/functions.js'); + $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('morefiles.php')); + $adminMenu->addItemButton(_AM_TDMCREATE_MORE_FILES_LIST, 'morefiles.php', 'list'); + $GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton()); + + $morefilesObj =& $tdmcreate->getHandler('morefiles')->create(); + $form = $morefilesObj->getForm(); + $GLOBALS['xoopsTpl']->assign('form', $form->render()); + break; + + case 'save': + if (!$GLOBALS['xoopsSecurity']->check()) { + redirect_header('morefiles.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors())); + } + if (isset($fileId)) { + $morefilesObj =& $tdmcreate->getHandler('morefiles')->get($fileId); + } else { + $morefilesObj =& $tdmcreate->getHandler('morefiles')->create(); + } + // Form file save + $morefilesObj->setVars(array( + 'file_mid' => $_POST['file_mid'], + 'file_name' => $_POST['file_name'], + 'file_extension' => $_POST['file_extension'], + 'file_infolder' => $_POST['file_infolder'])); + + if ($tdmcreate->getHandler('morefiles')->insert($morefilesObj)) { + if ($morefilesObj->isNew()) { + redirect_header('morefiles.php', 5, sprintf(_AM_TDMCREATE_FILE_FORM_CREATED_OK, $_POST['file_name'])); + } else { + redirect_header('morefiles.php', 5, sprintf(_AM_TDMCREATE_FILE_FORM_UPDATED_OK, $_POST['file_name'])); + } + } + + $GLOBALS['xoopsTpl']->assign('error', $morefilesObj->getHtmlErrors()); + $form =& $morefilesObj->getForm(); + $GLOBALS['xoopsTpl']->assign('form', $form->render()); + break; + + case 'edit': + // Define main template + $templateMain = 'tdmcreate_morefiles.tpl'; + $GLOBALS['xoTheme']->addScript('modules/tdmcreate/assets/js/functions.js'); + $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('morefiles.php')); + $adminMenu->addItemButton(_AM_TDMCREATE_ADD_MODULE, 'morefiles.php?op=new', 'add'); + $adminMenu->addItemButton(_AM_TDMCREATE_MORE_FILES_LIST, 'morefiles.php', 'list'); + $GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton()); + + $morefilesObj = $tdmcreate->getHandler('morefiles')->get($fileId); + $form = $morefilesObj->getForm(); + $GLOBALS['xoopsTpl']->assign('form', $form->render()); + break; + + case 'delete': + $morefilesObj =& $tdmcreate->getHandler('morefiles')->get($fileId); + if (isset($_REQUEST['ok']) && 1 == $_REQUEST['ok']) { + if (!$GLOBALS['xoopsSecurity']->check()) { + redirect_header('morefiles.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors())); + } + if ($tdmcreate->getHandler('morefiles')->delete($morefilesObj)) { + redirect_header('morefiles.php', 3, _AM_TDMCREATE_FORM_DELETED_OK); + } else { + $GLOBALS['xoopsTpl']->assign('error', $morefilesObj->getHtmlErrors()); + } + } else { + xoops_confirm(array('ok' => 1, 'file_id' => $fileId, 'op' => 'delete'), $_SERVER['REQUEST_URI'], sprintf(_AM_TDMCREATE_FORM_SURE_DELETE, $morefilesObj->getVar('file_name'))); + } + break; +} + +include __DIR__ . '/footer.php'; Added: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/assets/icons/32/files.png =================================================================== (Binary files differ) Index: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/assets/icons/32/files.png =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/assets/icons/32/files.png 2015-06-10 16:08:35 UTC (rev 13086) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/assets/icons/32/files.png 2015-06-12 21:33:08 UTC (rev 13087) Property changes on: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/assets/icons/32/files.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/fieldattributes.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/fieldattributes.php 2015-06-10 16:08:35 UTC (rev 13086) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/fieldattributes.php 2015-06-12 21:33:08 UTC (rev 13087) @@ -14,9 +14,9 @@ * @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.91 fieldattributes.php 11297 2014-05-14 10:58:10Z timgno $ + * @since 2.5.7 + * @author Txmod Xoops <web...@tx...> - <http://www.txmodxoops.org/> + * @version $Id: 1.91 fieldattributes.php 13027 2015-02-14 12:18:10Z timgno $ */ defined('XOOPS_ROOT_PATH') or die('Restricted access'); Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/fields.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/fields.php 2015-06-10 16:08:35 UTC (rev 13086) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/fields.php 2015-06-12 21:33:08 UTC (rev 13087) @@ -15,8 +15,8 @@ * @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 + * @since 2.5.7 + * @author Txmod Xoops <web...@tx...> - <http://www.txmodxoops.org/> * @version $Id: 1.91 fields.php 12258 2014-01-02 09:33:29Z timgno $ */ defined('XOOPS_ROOT_PATH') or die('Restricted access'); Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateArchitecture.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateArchitecture.php 2015-06-10 16:08:35 UTC (rev 13086) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateArchitecture.php 2015-06-12 21:33:08 UTC (rev 13087) @@ -93,15 +93,15 @@ } // $indexFile = XOOPS_UPLOAD_PATH . '/index.html'; - $cache1 = TDMC_CLASSES_PATH . '/cache'; - $cache2 = TDMC_CLASSES_PATH . '/files/cache'; $stlModuleAuthor = str_replace(' ', '', strtolower($module->getVar('mod_author'))); $this->structure->setModuleName($module->getVar('mod_dirname')); $uploadPath = $this->structure->getUploadPath(); // Creation of "module" folder in the Directory repository $this->structure->makeDir($uploadPath . '/' . $this->structure->getModuleName()); - // Copied of index.html file in "root module" folder - //$this->structure->copyFile('', $indexFile, 'index.html'); + if (1 != $module->getVar('mod_user')) { + // Copied of index.html file in "root module" folder + $this->structure->copyFile('', $indexFile, 'index.html'); + } if (1 == $module->getVar('mod_admin')) { // Creation of "admin" folder and index.html file $this->structure->makeDirAndCopyFile('admin', $indexFile, 'index.html'); Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/admin/AdminPages.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/admin/AdminPages.php 2015-06-10 16:08:35 UTC (rev 13086) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/admin/AdminPages.php 2015-06-12 21:33:08 UTC (rev 13087) @@ -82,12 +82,13 @@ { $ucfModuleDirname = ucfirst($moduleDirname); $ucfTableName = ucfirst($tableName); + $ccFieldId = $this->tdmcfile->getCamelCase($fieldId, false, true); $ret = <<<EOT include __DIR__ . '/header.php'; //It recovered the value of argument op in URL$ \$op = XoopsRequest::getString('op', 'list'); // Request {$fieldId} -\${$fieldId} = XoopsRequest::getInt('{$fieldId}'); +\${$ccFieldId} = XoopsRequest::getInt('{$fieldId}'); // Switch options switch (\$op) {\n @@ -200,13 +201,14 @@ */ private function getAdminPagesSave($moduleDirname, $tableName, $language, $fields, $fieldId, $fieldMain) { - $ret = <<<EOT + $ccFieldId = $this->tdmcfile->getCamelCase($fieldId, false, true); + $ret = <<<EOT case 'save': if ( !\$GLOBALS['xoopsSecurity']->check() ) { redirect_header('{$tableName}.php', 3, implode(',', \$GLOBALS['xoopsSecurity']->getErrors())); } - if (isset(\${$fieldId})) { - \${$tableName}Obj =& \${$tableName}Handler->get(\${$fieldId}); + if (isset(\${$ccFieldId})) { + \${$tableName}Obj =& \${$tableName}Handler->get(\${$ccFieldId}); } else { \${$tableName}Obj =& \${$tableName}Handler->create(); } @@ -277,6 +279,7 @@ $stuTableName = strtoupper($tableName); $stuTableSoleName = strtoupper($tableSoleName); $stuTableFieldname = strtoupper($tableFieldname); + $ccFieldId = $this->tdmcfile->getCamelCase($fieldId, false, true); $ret = <<<EOT case 'edit': \$templateMain = '{$moduleDirname}_admin_{$tableName}.tpl'; @@ -285,7 +288,7 @@ \$GLOBALS['xoopsTpl']->assign('navigation', \$adminMenu->addNavigation('{$tableName}.php')); \$GLOBALS['xoopsTpl']->assign('buttons', \$adminMenu->renderButton()); // Get Form - \${$tableName}Obj = \${$tableName}Handler->get(\${$fieldId}); + \${$tableName}Obj = \${$tableName}Handler->get(\${$ccFieldId}); \$form = \${$tableName}Obj->getForm(); \$GLOBALS['xoopsTpl']->assign('form', \$form->render()); break;\n @@ -304,9 +307,10 @@ */ private function getAdminPagesDelete($tableName, $language, $fieldId, $fieldMain) { - $ret = <<<EOT + $ccFieldId = $this->tdmcfile->getCamelCase($fieldId, false, true); + $ret = <<<EOT case 'delete': - \${$tableName}Obj =& \${$tableName}Handler->get(\${$fieldId}); + \${$tableName}Obj =& \${$tableName}Handler->get(\${$ccFieldId}); if (isset(\$_REQUEST['ok']) && 1 == \$_REQUEST['ok']) { if ( !\$GLOBALS['xoopsSecurity']->check() ) { redirect_header('{$tableName}.php', 3, implode(', ', \$GLOBALS['xoopsSecurity']->getErrors())); @@ -314,10 +318,10 @@ if (\${$tableName}Handler->delete(\${$tableName}Obj)) { redirect_header('{$tableName}.php', 3, {$language}FORM_DELETE_OK); } else { - echo \${$tableName}Obj->getHtmlErrors(); + \$GLOBALS['xoopsTpl']->assign('error', \${$tableName}Obj->getHtmlErrors()); } } else { - xoops_confirm(array('ok' => 1, '{$fieldId}' => \${$fieldId}, 'op' => 'delete'), \$_SERVER['REQUEST_URI'], sprintf({$language}FORM_SURE_DELETE, \${$tableName}Obj->getVar('{$fieldMain}'))); + xoops_confirm(array('ok' => 1, '{$fieldId}' => \${$ccFieldId}, 'op' => 'delete'), \$_SERVER['REQUEST_URI'], sprintf({$language}FORM_SURE_DELETE, \${$tableName}Obj->getVar('{$fieldMain}'))); } break;\n EOT; @@ -336,17 +340,17 @@ private function getAdminPagesUpdate($moduleDirname, $tableName, $fieldId, $fieldName) { $stuModuleName = strtoupper($moduleDirname); + $ccFieldId = $this->tdmcfile->getCamelCase($fieldId, false, true); $ret = <<<EOT case 'update': - if (isset(\${$fieldId})) { - \${$tableName}Obj =& \${$tableName}Handler->get(\${$fieldId}); + if (isset(\${$ccFieldId})) { + \${$tableName}Obj =& \${$tableName}Handler->get(\${$ccFieldId}); } - \${$tableName}Obj->setVar("\${$fieldName}", \$_POST["\${$fieldName}"]); - + \${$tableName}Obj->setVar('{$fieldName}', \$_POST['{$fieldName}']); if (\${$tableName}Handler->insert(\${$tableName}Obj)) { - redirect_header("\${$tableName}.php", 3, _AM_{$stuModuleName}_FORM_OK); + redirect_header('{$tableName}.php', 3, _AM_{$stuModuleName}_FORM_OK); } - echo \${$tableName}Obj->getHtmlErrors(); + \$GLOBALS['xoopsTpl']->assign('error', \${$tableName}Obj->getHtmlErrors()); break;\n EOT; Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/classes/ClassFiles.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/classes/ClassFiles.php 2015-06-10 16:08:35 UTC (rev 13086) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/classes/ClassFiles.php 2015-06-12 21:33:08 UTC (rev 13087) @@ -658,7 +658,7 @@ public function &getInsertId() { return \$this->db->getInsertId(); - }\n\n + }\n\n EOT; return $ret; Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/classes/ClassFormElements.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/classes/ClassFormElements.php 2015-06-10 16:08:35 UTC (rev 13086) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/classes/ClassFormElements.php 2015-06-12 21:33:08 UTC (rev 13087) @@ -617,7 +617,34 @@ return $ret; } + + /* + * @private function getXoopsFormTag + * @param string $moduleDirname + * @param string $fieldId + * @param string $required + */ + /** + * @param $moduleDirname + * @param $fieldId + * @param string $required + * @return string + */ + private function getXoopsFormTag($moduleDirname, $fieldId, $required = 'false') + { + $ret = <<<EOT + // Use tag module + \$dirTag = is_dir(XOOPS_ROOT_PATH . '/modules/tag') ? true : false; + if ((\$this->{$moduleDirname}->getConfig('usetag') == 1) && \$dirTag){ + \$tagId = \$this->isNew() ? 0 : \$this->getVar('{$fieldId}'); + include_once XOOPS_ROOT_PATH.'/modules/tag/include/formtag.php'; + \$form->addElement(new XoopsFormTag('tag', 60, 255, \$tagId, 0){$required}); + }\n +EOT; + return $ret; + } + /* * @public function renderElements * @param null @@ -707,7 +734,11 @@ $ret .= $this->getXoopsFormTextDateSelect($language, $moduleDirname, $fieldName, $required); break; default: - // If we want to hide XoopsFormHidden() or field id + // If we use tag module + if (1 == $table->getVar('table_tag')) { + $ret .= $this->getXoopsFormTag($moduleDirname, $fieldId, $required); + } + // If we want to hide XoopsFormHidden() or field id if ((0 == $f) && (1 == $table->getVar('table_autoincrement'))) { $ret .= $this->getXoopsFormHidden($fieldName); } Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/language/LanguageAdmin.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/language/LanguageAdmin.php 2015-06-10 16:08:35 UTC (rev 13086) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/language/LanguageAdmin.php 2015-06-12 21:33:08 UTC (rev 13087) @@ -174,7 +174,7 @@ $fieldNameDesc = substr($fieldElementName, strrpos($fieldElementName, ':'), strlen($fieldElementName)); $fieldNameDesc = str_replace(': ', '', $fieldNameDesc); } else { - $fieldNameDesc = ucfirst($rpFieldName); + $fieldNameDesc = strstr($rpFieldName, '_') ? str_replace('_', ' ', ucfirst($rpFieldName)) : ucfirst($rpFieldName); } // $ret .= $this->defines->getDefine($language, $tableSoleName . '_' . $rpFieldName, $fieldNameDesc); @@ -259,6 +259,7 @@ public function render() { $module = $this->getModule(); + $table = $this->getTable(); $tables = $this->getTables(); $filename = $this->getFileName(); $moduleDirname = $module->getVar('mod_dirname'); @@ -267,9 +268,11 @@ if (is_array($tables)) { $content .= $this->getLanguageAdminIndex($language, $tables); $content .= $this->getLanguageAdminPages($language, $tables); - $content .= $this->getLanguageAdminClass($language, $tables); - $content .= $this->getLanguageAdminPermissions($language); + $content .= $this->getLanguageAdminClass($language, $tables); } + if (1 == $table->getVar('table_permissions')) { + $content .= $this->getLanguageAdminPermissions($language); + } $content .= $this->getLanguageAdminFoot($language); // $this->tdmcfile->create($moduleDirname, 'language/english', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED); Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/admin/TemplatesAdminPages.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/admin/TemplatesAdminPages.php 2015-06-10 16:08:35 UTC (rev 13086) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/admin/TemplatesAdminPages.php 2015-06-12 21:33:08 UTC (rev 13087) @@ -298,7 +298,7 @@ $moduleDirname = $module->getVar('mod_dirname'); $tableFieldname = $table->getVar('table_fieldname'); $language = $this->getLanguage($moduleDirname, 'AM'); - $fields = $this->getTableFields($table->getVar('table_mid'), $table->getVar('table_id')); + $fields = $this->getTableFields($table->getVar('table_mid'), $table->getVar('table_id'), 'field_order ASC'); $content = $this->getTemplatesAdminPagesHeader($moduleDirname, $table, $fields, $language); // Verify if table_fieldname is not empty if (!empty($tableFieldname)) { Added: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/user/TemplatesUserMoreFiles.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/user/TemplatesUserMoreFiles.php (rev 0) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/user/TemplatesUserMoreFiles.php 2015-06-12 21:33:08 UTC (rev 13087) @@ -0,0 +1,122 @@ +<?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: TemplatesUserMoreFiles.php 12258 2014-01-02 09:33:29Z timgno $ + */ +defined('XOOPS_ROOT_PATH') or die('Restricted access'); + +/** + * Class TemplatesUserMoreFiles + */ +class TemplatesUserMoreFiles extends TDMCreateFile +{ + // + private $folder; + // + private $extension; + /* + * @public function constructor + * @param null + */ + /** + * + */ + public function __construct() + { + parent::__construct(); + $this->tdmcfile = TDMCreateFile::getInstance(); + } + + /* + * @static function &getInstance + * @param null + */ + /** + * @return TemplatesUserMoreFiles + */ + public static function &getInstance() + { + static $instance = false; + if (!$instance) { + $instance = new self(); + } + + return $instance; + } + + /* + * @public function write + * @param string $module + * @param string $filename + */ + /** + * @param $module + * @param $filename + * @return string + */ + public function write($module, $folder = '', $filename, $extension) + { + $this->setModule($module); + $this->setFileName($filename); + if($folder != ''){ + $this->folder = 'templates/'.$folder; + } else { + $this->folder = 'templates'; + } + $this->extension = $extension; + } + + /* + * @private function getTemplatesUserMoreFile + * @param null + */ + /** + * @param null + * @return string + */ + private function getTemplatesUserMoreFile() + { + $ret = <<<EOT +<div class="panel"> + Pleace! Enter here your template code here +</div> +EOT; + + return $ret; + } + + /* + * @public function renderFile + * @param string $filename + */ + /** + * @param $filename + * @return bool|string + */ + public function renderFile() + { + $module = $this->getModule(); + $filename = $this->getFileName(); + $moduleDirname = $module->getVar('mod_dirname'); + $content = $this->getTemplatesUserMoreFile(); + // + $this->tdmcfile->create($moduleDirname, $this->folder, $filename . '.' . $this->extension, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED); + + return $this->tdmcfile->renderFile(); + } +} Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/modules.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/modules.php 2015-06-10 16:08:35 UTC (rev 13086) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/modules.php 2015-06-12 21:33:08 UTC (rev 13087) @@ -16,8 +16,8 @@ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) * @package tdmcreate * @since 2.5.7 - * @author TDM TEAM DEV MODULE - * @version $Id: modules.php 13040 2015-04-25 15:12:12Z timgno $ + * @author Txmod Xoops <web...@tx...> - <http://www.txmodxoops.org/> + * @version $Id: 1.91 modules.php 13040 2015-04-25 15:12:12Z timgno $ */ defined('XOOPS_ROOT_PATH') or die('Restricted access'); include __DIR__ . '/autoload.php'; Added: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/morefiles.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/morefiles.php (rev 0) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/morefiles.php 2015-06-12 21:33:08 UTC (rev 13087) @@ -0,0 +1,261 @@ +<?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. + */ + +/** + * morefiles class + * + * @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.7 + * @author Txmod Xoops <web...@tx...> - <http://www.txmodxoops.org/> + * @version $Id: morefiles.php 13080 2015-06-12 10:12:32Z timgno $ + */ +defined('XOOPS_ROOT_PATH') or die('Restricted access'); +include __DIR__ . '/autoload.php'; +/* +* @Class TDMCreateMoreFiles +* @extends XoopsObject +*/ + +/** + * Class TDMCreateMoreFiles + */ +class TDMCreateMoreFiles extends XoopsObject +{ + /** + * Tdmcreate + * + * @var mixed + */ + private $tdmcreate; + + /** + * Settings + * + * @var mixed + */ + private $settings; + + /* + * @public function constructor class + * @param null + */ + /** + * + */ + public function __construct() + { + $this->tdmcreate = TDMCreateHelper::getInstance(); + // + $this->initVar('file_id', XOBJ_DTYPE_INT); + $this->initVar('file_mid', XOBJ_DTYPE_INT); + $this->initVar('file_name', XOBJ_DTYPE_TXTBOX); + $this->initVar('file_extension', XOBJ_DTYPE_TXTBOX); + $this->initVar('file_infolder', XOBJ_DTYPE_TXTBOX); + } + + /** + * @param string $method + * @param array $args + * + * @return mixed + */ + public function __call($method, $args) + { + $arg = isset($args[0]) ? $args[0] : null; + + return $this->getVar($method, $arg); + } + + /* + * @static function &getInstance + * @param null + */ + /** + * @return TDMCreateMoreFiles + */ + public static function &getInstance() + { + static $instance = false; + if (!$instance) { + $instance = new self(); + } + + return $instance; + } + + /* + * @public function getForm + * @param mixed $action + */ + /** + * @param bool $action + * @return XoopsThemeForm + */ + public function getForm($action = false) + { + // + if ($action === false) { + $action = $_SERVER['REQUEST_URI']; + } + // + $isNew = $this->isNew(); + $title = $isNew ? sprintf(_AM_TDMCREATE_MORE_FILES_NEW) : sprintf(_AM_TDMCREATE_MORE_FILES_EDIT); + // + xoops_load('XoopsFormLoader'); + // + $form = new XoopsThemeForm($title, 'morefilesform', $action, 'post', true); + $form->setExtra('enctype="multipart/form-data"'); + // + $modules = $this->tdmcreate->getHandler('modules')->getObjects(null); + $modulesSelect = new XoopsFormSelect(_AM_TDMCREATE_MORE_FILES_MODULES, 'file_mid', $this->getVar('file_mid')); + $modulesSelect->addOption('', _AM_TDMCREATE_MORE_FILES_MODULE_SELECT); + foreach ($modules as $mod) { + //$modulesSelect->addOptionArray(); + $modulesSelect->addOption($mod->getVar('mod_id'), $mod->getVar('mod_name')); + } + $form->addElement($modulesSelect, true); + // + $modName = new XoopsFormText(_AM_TDMCREATE_MORE_FILES_NAME, 'file_name', 50, 255, $this->getVar('file_name')); + $modName->setDescription(_AM_TDMCREATE_MORE_FILES_NAME_DESC); + $form->addElement($modName, true); + // + $fileEstension = new XoopsFormText(_AM_TDMCREATE_MORE_FILES_EXTENSION, 'file_extension', 50, 255, $this->getVar('file_extension')); + $fileEstension->setDescription(_AM_TDMCREATE_MORE_FILES_EXTENSION_DESC); + $form->addElement($fileEstension, true); + // + $fileInfolder = new XoopsFormText(_AM_TDMCREATE_MORE_FILES_INFOLDER, 'file_infolder', 50, 255, $this->getVar('file_infolder')); + $fileInfolder->setDescription(_AM_TDMCREATE_MORE_FILES_INFOLDER_DESC); + $form->addElement($fileInfolder, true); + // + $form->addElement(new XoopsFormHidden('op', 'save')); + $form->addElement(new XoopsFormButton(_REQUIRED . ' <sup class="red bold">*</sup>', 'submit', _SUBMIT, 'submit')); + + return $form; + } + + /** + * Get Values + */ + public function getValues($keys = null, $format = null, $maxDepth = null) + { + $ret = parent::getValues($keys, $format, $maxDepth); + // Values + $ret['id'] = $this->getVar('file_id'); + $ret['mid'] = $this->tdmcreate->getHandler('modules')->get($this->getVar('file_mid'))->getVar('mod_name'); + $ret['name'] = $this->getVar('file_name'); + $ret['extension'] = $this->getVar('file_extension'); + $ret['infolder'] = $this->getVar('file_infolder'); + + return $ret; + } +} + +/* +* @Class TDMCreateMoreFilesHandler +* @extends XoopsPersistableObjectHandler +*/ + +/** + * Class TDMCreateMoreFilesHandler + */ +class TDMCreateMoreFilesHandler extends XoopsPersistableObjectHandler +{ + /* + * @public function constructor class + * @param mixed $db + */ + /** + * @param null|object $db + */ + public function __construct(&$db) + { + parent::__construct($db, 'tdmcreate_morefiles', 'tdmcreatemorefiles', 'file_id', 'file_name'); + } + + /** + * @param bool $isNew + * + * @return object + */ + public function &create($isNew = true) + { + return parent::create($isNew); + } + + /** + * retrieve a field + * + * @param int $i field id + * @param null $fields + * @return mixed reference to the <a href='psi_element://TDMCreateFields'>TDMCreateFields</a> object + * object + */ + public function &get($i = null, $fields = null) + { + return parent::get($i, $fields); + } + + /** + * get inserted id + * + * @param null + * @return integer reference to the {@link TDMCreateTables} object + */ + public function &getInsertId() + { + return $this->db->getInsertId(); + } + + /** + * insert a new field in the database + * + * @param object $field reference to the {@link TDMCreateFields} object + * @param bool $force + * + * @return bool FALSE if failed, TRUE if already present and unchanged or successful + */ + public function &insert(&$field, $force = false) + { + if (!parent::insert($field, $force)) { + return false; + } + + return true; + } + + /** + * Get Count Modules + */ + public function getCountMoreFiles($start = 0, $limit = 0, $sort = 'file_id ASC, file_name', $order = 'ASC') + { + $criteria = new CriteriaCompo(); + $criteria->setSort($sort); + $criteria->setOrder($order); + $criteria->setStart($start); + $criteria->setLimit($limit); + return parent::getCount($criteria); + } + + /** + * Get All Modules + */ + public function getAllMoreFiles($start = 0, $limit = 0, $sort = 'file_id ASC, file_name', $order = 'ASC') + { + $criteria = new CriteriaCompo(); + $criteria->setSort($sort); + $criteria->setOrder($order); + $criteria->setStart($start); + $criteria->setLimit($limit); + return parent::getAll($criteria); + } +} Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/tables.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/tables.php 2015-06-10 16:08:35 UTC (rev 13086) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/tables.php 2015-06-12 21:33:08 UTC (rev 13087) @@ -16,7 +16,7 @@ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) * @package tdmcreate * @since 2.5.7 - * @author Txmod Xoops <su...@tx...> + * @author Txmod Xoops <web...@tx...> - <http://www.txmodxoops.org/> * @version $Id: 1.91 tables.php 11297 2013-03-24 10:58:10Z timgno $ */ defined('XOOPS_ROOT_PATH') or die('Restricted access'); @@ -153,7 +153,7 @@ $tableMid = $this->getVar('table_mid'); $title = $isNew ? sprintf(_AM_TDMCREATE_TABLE_NEW) : sprintf(_AM_TDMCREATE_TABLE_EDIT); - xoops_load('xoopsformloader'); + xoops_load('XoopsFormLoader'); $form = new XoopsThemeForm($title, 'tableform', $action, 'post', true); $form->setExtra('enctype="multipart/form-data"'); // Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/language/english/admin.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/language/english/admin.php 2015-06-10 16:08:35 UTC (rev 13086) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/language/english/admin.php 2015-06-12 21:33:08 UTC (rev 13087) @@ -202,13 +202,13 @@ define('_AM_TDMCREATE_TABLE_AUTO_INCREMENT_DESC', "Check this option if table have the Auto Increment ID"); // v1.59 define('_AM_TDMCREATE_TABLE_EXIST', "The name specified for this table is already in use"); -define('_AM_TDMCREATE_TABLE_BLOCKS', "Add in Block file"); +define('_AM_TDMCREATE_TABLE_BLOCKS', "Add in Block Files"); define('_AM_TDMCREATE_TABLE_BLOCKS_DESC', "(blocks: random, latest, today)"); -define('_AM_TDMCREATE_TABLE_ADMIN', "Add in Admin Panel"); -define('_AM_TDMCREATE_TABLE_USER', "Add in User Side"); +define('_AM_TDMCREATE_TABLE_ADMIN', "Add in Admin Files"); +define('_AM_TDMCREATE_TABLE_USER', "Add in User Files"); define('_AM_TDMCREATE_TABLE_SUBMENU', "Add in Submenu"); -define('_AM_TDMCREATE_TABLE_SEARCH', "Add in Search file"); -define('_AM_TDMCREATE_TABLE_COMMENTS', "Add in Comments file"); +define('_AM_TDMCREATE_TABLE_SEARCH', "Add in Search Files"); +define('_AM_TDMCREATE_TABLE_COMMENTS', "Add in Comments Files"); // Added in version 1.39 define('_AM_TDMCREATE_TABLE_NOTIFICATIONS', "Add in Notifications file"); define('_AM_TDMCREATE_TABLE_PERMISSIONS', "Add in Permissions file"); @@ -371,10 +371,33 @@ // define('_AM_TDMCREATE_BUILDING_DIRECTORY', "Files created in the directory <span class='bold'>uploads/tdmcreate/repository/</span> of the module <span class='bold green'>%s</span>"); define('_AM_TDMCREATE_FIELD_PARAMETERS_LIST', "<b>Parameters List</b>"); -// v1.91 +// Added in version v1.91 define('_AM_TDMCREATE_ABOUT_MAKE_DONATION', "Make a Donation to support this module"); define('_AM_TDMCREATE_IMPORTANT', "Main Settings"); define('_AM_TDMCREATE_OPTIONS_CHECK', "Options Settings"); define('_AM_TDMCREATE_CREATE_IMAGE', "Create Image Logo"); define('_AM_TDMCREATE_NOT_IMPORTANT', "Secondary Settings"); -define('_AM_TDMCREATE_BUILDING_DELETED_CACHE_FILES', "Cache Files Are Deleted Succefully"); \ No newline at end of file +define('_AM_TDMCREATE_BUILDING_DELETED_CACHE_FILES', "Cache Files Are Deleted Succefully"); +// Admin More Files +define('_AM_TDMCREATE_ADD_MORE_FILE', "Add More File"); +define('_AM_TDMCREATE_MORE_FILES_LIST', "More Files List"); +define('_AM_TDMCREATE_FILE_FORM_CREATED_OK', "The file <b class='green'>%s</b> is successfully created"); +define('_AM_TDMCREATE_FILE_FORM_UPDATED_OK', "The file <b class='green'>%s</b> is successfully updated"); +// Class More Files +define('_AM_TDMCREATE_MORE_FILES_NEW', "New More File"); +define('_AM_TDMCREATE_MORE_FILES_EDIT', "Edit More File"); +define('_AM_TDMCREATE_MORE_FILES_MODULES', "Choose a module"); +define('_AM_TDMCREATE_MORE_FILES_MODULE_SELECT', "Select a Module"); +define('_AM_TDMCREATE_MORE_FILES_NAME', "File Name"); +define('_AM_TDMCREATE_MORE_FILES_NAME_DESC', "Create file name without extension"); +define('_AM_TDMCREATE_MORE_FILES_EXTENSION', "Extension File"); +define('_AM_TDMCREATE_MORE_FILES_EXTENSION_DESC', "Create extension of this file without dot"); +define('_AM_TDMCREATE_MORE_FILES_INFOLDER', "File in the folder"); +define('_AM_TDMCREATE_MORE_FILES_INFOLDER_DESC', "Insert this file in a folder (Type: admin, user, class, include, templates, ...)"); +// Template More Files +define('_AM_TDMCREATE_FILE_ID', "Id"); +define('_AM_TDMCREATE_FILE_NAME_LIST', "File Name"); +define('_AM_TDMCREATE_FILE_MID_LIST', "Module Name"); +define('_AM_TDMCREATE_FILE_EXTENSION_LIST', "Extension Type"); +define('_AM_TDMCREATE_FILE_INFOLDER_LIST', "In Folder"); +define('_AM_TDMCREATE_FORM_ACTION', "Action"); \ No newline at end of file Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/language/english/modinfo.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/language/english/modinfo.php 2015-06-10 16:08:35 UTC (rev 13086) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/language/english/modinfo.php 2015-06-12 21:33:08 UTC (rev 13087) @@ -27,8 +27,9 @@ define('_MI_TDMCREATE_ADMENU3', "Modules"); define('_MI_TDMCREATE_ADMENU4', "Tables"); define('_MI_TDMCREATE_ADMENU5', "Fields"); -define('_MI_TDMCREATE_ADMENU6', "Building"); -define('_MI_TDMCREATE_ADMENU7', "About"); +define('_MI_TDMCREATE_ADMENU6', "More Files"); +define('_MI_TDMCREATE_ADMENU7', "Building"); +define('_MI_TDMCREATE_ABOUT', "About"); // 1.37 define('_MI_TDMCREATE_CONFIG_EDITOR', "Editor"); define('_MI_TDMCREATE_CONFIG_EDITOR_DESC', "Select an editor for the description"); Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/sql/mysql.sql =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/sql/mysql.sql 2015-06-10 16:08:35 UTC (rev 13086) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/sql/mysql.sql 2015-06-12 21:33:08 UTC (rev 13087) @@ -316,3 +316,16 @@ (13, 0, 0, 'UploadImage', 'XoopsFormUploadImage'), (14, 0, 0, 'UploadFile', 'XoopsFormUploadFile'), (15, 0, 0, 'TextDateSelect', 'XoopsFormTextDateSelect'); + +# +# Table structure for table `tdmcreate_morefiles` 5 +# + +CREATE TABLE `tdmcreate_morefiles` ( + `file_id` INT(5) UNSIGNED NOT NULL AUTO_INCREMENT, + `file_mid` INT(5) UNSIGNED NOT NULL DEFAULT '0', + `file_name` VARCHAR(100) NOT NULL DEFAULT '', + `file_extension` VARCHAR(5) NOT NULL DEFAULT '.php', + `file_infolder` VARCHAR(50) NOT NULL DEFAULT '', + PRIMARY KEY (`file_id`) +)ENGINE =InnoDB; \ No newline at end of file Added: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/templates/admin/tdmcreate_morefiles.tpl =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/templates/admin/tdmcreate_morefiles.tpl (rev 0) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/templates/admin/tdmcreate_morefiles.tpl 2015-06-12 21:33:08 UTC (rev 13087) @@ -0,0 +1,47 @@ +<!-- Header --> +<{includeq file="db:tdmcreate_header.tpl"}> +<!-- Display files list --> +<{if $files_list}> + <table class='outer width100'> + <tr> + <th class='center'><{$smarty.const._AM_TDMCREATE_FILE_ID}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_FILE_MID_LIST}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_FILE_NAME_LIST}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_FILE_EXTENSION_LIST}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_FILE_INFOLDER_LIST}></th> + <th class='center width5'><{$smarty.const._AM_TDMCREATE_FORM_ACTION}></th> + </tr> + <{foreach item=file from=$files_list key=file_id}> + <tr id="file<{$file.id}>" class="files"> + <td class='center bold width5'><{$file.id}></td> + <td class='center bold'><{$file.mid}></td> + <td class='center bold green'><{$file.name}></td> + <td class='center'><{$file.extension}></td> + <td class='center'><{$file.infolder}></td> + <td class='xo-actions txtcenter width5'> + <a href="morefiles.php?op=edit&file_id=<{$file.id}>" title="<{$smarty.const._EDIT}>"> + <img src="<{xoModuleIcons16 edit.png}>" alt="<{$smarty.const._EDIT}>" /> + </a> + <a href="morefiles.php?op=delete&file_id=<{$file.id}>" title="<{$smarty.const._DELETE}>"> + <img src="<{xoModuleIcons16 delete.png}>" alt="<{$smarty.const._DELETE}>" /> + </a> + </td> + </tr> + <{/foreach}> + </table><br /><br /> + <!-- Display files navigation --> + <div class="clear"> </div> + <{if $pagenav}><div class="xo-pagenav floatright"><{$pagenav}></div><div class="clear spacer"></div><{/if}> +<{else}> <!-- Display file images on edit page --> + <!-- Display file form (add,edit) --> + <{if $form}> + <div class="spacer"><{$form}></div> + <{/if}> +<{/if}> +<{if $error}> +<div class="errorMsg"> + <strong><{$error}></strong> +</div> +<{/if}> +<!-- Footer --> +<{includeq file="db:tdmcreate_footer.tpl"}> Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/xoops_version.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/xoops_version.php 2015-06-10 16:08:35 UTC (rev 13086) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/xoops_version.php 2015-06-12 21:33:08 UTC (rev 13087) @@ -79,19 +79,23 @@ $modversion['templates'][] = array( 'file' => 'tdmcreate_tables.tpl', 'description' => '', 'type' => 'admin' ); $modversion['templates'][] = array( 'file' => 'tdmcreate_tables_item.tpl', 'description' => '', 'type' => 'admin' ); $modversion['templates'][] = array( 'file' => 'tdmcreate_settings.tpl', 'description' => '', 'type' => 'admin' ); +$modversion['templates'][] = array( 'file' => 'tdmcreate_morefiles.tpl', 'description' => '', 'type' => 'admin' ); // Mysql file $modversion['sqlfile']['mysql'] = "sql/mysql.sql"; // Tables -$modversion['tables'][1] = "tdmcreate_settings"; -$modversion['tables'][2] = "tdmcreate_modules"; -$modversion['tables'][3] = "tdmcreate_tables"; -$modversion['tables'][4] = "tdmcreate_fields"; -$modversion['tables'][5] = "tdmcreate_languages"; -$modversion['tables'][6] = "tdmcreate_fieldtype"; -$modversion['tables'][7] = "tdmcreate_fieldattributes"; -$modversion['tables'][8] = "tdmcreate_fieldnull"; -$modversion['tables'][9] = "tdmcreate_fieldkey"; -$modversion['tables'][10] = "tdmcreate_fieldelements"; +$i = 1; +$modversion['tables'][$i] = "tdmcreate_settings"; +$modversion['tables'][$i] = "tdmcreate_modules"; +$modversion['tables'][$i] = "tdmcreate_tables"; +$modversion['tables'][$i] = "tdmcreate_fields"; +$modversion['tables'][$i] = "tdmcreate_languages"; +$modversion['tables'][$i] = "tdmcreate_fieldtype"; +$modversion['tables'][$i] = "tdmcreate_fieldattributes"; +$modversion['tables'][$i] = "tdmcreate_fieldnull"; +$modversion['tables'][$i] = "tdmcreate_fieldkey"; +$modversion['tables'][$i] = "tdmcreate_fieldelements"; +$modversion['tables'][$i] = "tdmcreate_morefiles"; +unset($i); // Scripts to run upon installation or update $modversion['onInstall'] = "include/install.php"; $modversion['onUpdate'] = "include/update.php"; @@ -153,6 +157,13 @@ $modversion['config'][$i]['valuetype'] = "int"; $modversion['config'][$i]['default'] = 10; $i++; +$modversion['config'][$i]['name'] = "morefiles_adminpager"; +$modversion['config'][$i]['title'] = "_MI_TDMCREATE_CONFIG_MOREFILES_ADMINPAGER"; +$modversion['config'][$i]['description'] = "_MI_TDMCREATE_CONFIG_"; +$modversion['config'][$i]['formtype'] = "textbox"; +$modversion['config'][$i]['valuetype'] = "int"; +$modversion['config'][$i]['default'] = 10; +$i++; $modversion['config'][$i]['name'] = "break" . $i; $modversion['config'][$i]['title'] = "_MI_TDMCREATE_CONFIG_BREAK_REQUIRED"; $modversion['config'][$i]['description'] = "_MI_TDMCREATE_CONFIG_"; |
From: <txm...@us...> - 2015-06-13 14:20:15
|
Revision: 13088 http://sourceforge.net/p/xoops/svn/13088 Author: txmodxoops Date: 2015-06-13 14:20:13 +0000 (Sat, 13 Jun 2015) Log Message: ----------- Fix Refacoring More Files Updated Modified Paths: -------------- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/assets/css/admin/style.css XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateArchitecture.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateTableFields.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/admin/AdminMenu.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/language/LanguageModinfo.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/admin/TemplatesAdminPages.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/user/TemplatesUserIndex.php Added Paths: ----------- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateMoreFiles.php Removed Paths: ------------- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/TDMCreateHtmlSmartyCodes.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/user/TemplatesUserMoreFiles.php Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/assets/css/admin/style.css =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/assets/css/admin/style.css 2015-06-12 21:33:08 UTC (rev 13087) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/assets/css/admin/style.css 2015-06-13 14:20:13 UTC (rev 13088) @@ -95,6 +95,14 @@ min-width: 80px; } +tr.files td { + margin: 0; + padding: 5px; + border-bottom: 1px solid #ccc; + background-color:rgba(100,110,80,0.3); + vertical-align: middle; +} + /*#show_rows { margin: 0; padding: 0; width: 60%; } #sortable tr { margin: 0 3px 3px 3px; padding: 0.4em; padding-left: 1.5em; font-size: 1.1em; height: 16px; }*/ Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateArchitecture.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateArchitecture.php 2015-06-12 21:33:08 UTC (rev 13087) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateArchitecture.php 2015-06-13 14:20:13 UTC (rev 13088) @@ -216,10 +216,11 @@ $moduleDirname = $module->getVar('mod_dirname'); $icon32 = 'assets/icons/32'; $tables = $this->tdmcfile->getTableTables($modId); + $files = $this->tdmcfile->getTableMoreFiles($modId); $ret = array(); // $table = array(); - foreach (array_keys($tables) as $t) { + foreach(array_keys($tables) as $t) { $tableMid = $tables[$t]->getVar('table_mid'); $tableId = $tables[$t]->getVar('table_id'); $tableName = $tables[$t]->getVar('table_name'); @@ -283,7 +284,17 @@ $userTemplatesPagesList->write($module, $table); $ret[] = $userTemplatesPagesList->renderFile($moduleDirname . '_' . $tableName . '_list' . '.tpl'); } - } + + } + foreach(array_keys($files) as $t) { + $fileName = $files[$t]->getVar('file_name'); + $fileExtension = $files[$t]->getVar('file_extension'); + $fileInfolder = $files[$t]->getVar('file_infolder'); + // More File + $moreFiles = TDMCreateMoreFiles::getInstance(); + $moreFiles->write($module, $fileName, $fileInfolder, $fileExtension); + $ret[] = $moreFiles->render(); + } // Language Modinfo File $languageModinfo = LanguageModinfo::getInstance(); $languageModinfo->write($module, $table, $tables, 'modinfo.php'); Added: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateMoreFiles.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateMoreFiles.php (rev 0) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateMoreFiles.php 2015-06-13 14:20:13 UTC (rev 13088) @@ -0,0 +1,251 @@ +<?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: TDMCreateMoreFiles.php 12258 2014-01-02 09:33:29Z timgno $ + */ +defined('XOOPS_ROOT_PATH') or die('Restricted access'); +/** + * Class TDMCreateMoreFiles + */ +class TDMCreateMoreFiles extends TDMCreateFile +{ + // + private $folder; + // + private $extension; + /* + * @public function constructor + * @param null + */ + /** + * + */ + public function __construct() + { + parent::__construct(); + $this->tdmcfile = TDMCreateFile::getInstance(); + } + + /* + * @static function &getInstance + * @param null + */ + /** + * @return TDMCreateMoreFiles + */ + public static function &getInstance() + { + static $instance = false; + if (!$instance) { + $instance = new self(); + } + + return $instance; + } + + /* + * @public function write + * @param string $module + * @param string $filename + */ + /** + * @param $module + * @param $filename + * @return string + */ + public function write($module, $filename, $folder, $extension) + { + $this->setModule($module); + $this->extension = $extension; + $this->setFileName($filename . '.' . $extension); + if(strstr($folder, 'user')){ + $this->folder = '/'; + } else { + $this->folder = $folder; + } + } + + /* + * @private function getMoreFilesFilePhp + * @param $header + */ + /** + * @param $header + * @return string + */ + private function getMoreFilesFilePhp($header) + { + $ret = <<<EOT +<?php +{$header}\n +EOT; + + return $ret; + } + + /* + * @private function getMoreFilesFileTpl + * @param $header + */ + /** + * @param $header + * @return string + */ + private function getMoreFilesFileTpl() + { + $ret = <<<EOT +<div class="panel"> + Pleace! put your template code here +</div>\n +EOT; + + return $ret; + } + + /* + * @private function getMoreFilesFileHtml + * @param $header + */ + /** + * @param $header + * @return string + */ + private function getMoreFilesFileHtml() + { + $ret = <<<EOT +<div class="panel"> + Pleace! put your Html code here +</div>\n +EOT; + + return $ret; + } + + /* + * @private function getMoreFilesFileText + * @param null + */ + /** + * @param null + * @return string + */ + private function getMoreFilesFileText() + { + $ret = <<<EOT +Pleace! put your text code here\n +EOT; + + return $ret; + } + + /* + * @private function getMoreFilesFileSql + * @param null + */ + /** + * @param null + * @return string + */ + private function getMoreFilesFileSql() + { + $ret = <<<EOT +Pleace! put your sql code here\n +EOT; + + return $ret; + } + + /* + * @private function getMoreFilesFileCss + * @param $header + */ + /** + * @param $header + * @return string + */ + private function getMoreFilesFileCss($header) + { + $ret = <<<EOT +@charset "UTF-8"; +{$header}\n\nPleace! put your sql code here\n +EOT; + + return $ret; + } + + /* + * @private function getMoreFilesFileDefault + * @param null + */ + /** + * @param null + * @return string + */ + private function getMoreFilesFileDefault() + { + $ret = <<<EOT +\n +EOT; + + return $ret; + } + + /* + * @public function renderFile + * @param string $filename + */ + /** + * @param $filename + * @return bool|string + */ + public function renderFile() + { + $module = $this->getModule(); + $filename = $this->getFileName(); + $moduleDirname = $module->getVar('mod_dirname'); + $header = $this->getHeaderFilesComments($module, $filename, 0); + switch($this->extension) { + case 'php': + $content = $this->getMoreFilesFilePhp($header); + break; + case 'tpl': + $content = $this->getMoreFilesFileTpl(); + break; + case 'html': + $content = $this->getMoreFilesFileHtml(); + break; + case 'text': + $content = $this->getMoreFilesFileText(); + break; + case 'sql': + $content = $this->getMoreFilesFileSql(); + break; + case 'css': + $content = $this->getMoreFilesFileCss($header); + break; + default: + $content = $this->getMoreFilesFileDefault(); + break; + } + + // + $this->tdmcfile->create($moduleDirname, $this->folder, $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED); + + return $this->tdmcfile->renderFile(); + } +} Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateTableFields.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateTableFields.php 2015-06-12 21:33:08 UTC (rev 13087) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateTableFields.php 2015-06-13 14:20:13 UTC (rev 13088) @@ -108,4 +108,21 @@ return $fieldElements; } + + /** + * @public function getTableMoreFiles + * @param $mId + * @return mixed + */ + public function getTableMoreFiles($mId, $sort = 'file_id ASC, file_name', $order = 'ASC') + { + $criteria = new CriteriaCompo(); + $criteria->add(new Criteria('file_mid', $mId)); // $mId = module Id + $criteria->setSort($sort); + $criteria->setOrder($order); + $morefiles = $this->tdmcreate->getHandler('morefiles')->getObjects($criteria); + unset($criteria); + + return $morefiles; + } } Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/admin/AdminMenu.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/admin/AdminMenu.php 2015-06-12 21:33:08 UTC (rev 13087) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/admin/AdminMenu.php 2015-06-13 14:20:13 UTC (rev 13088) @@ -170,7 +170,7 @@ $content = $this->getHeaderFilesComments($module, $filename); $content .= $this->getAdminMenuHeader(); $content .= $this->getAdminMenuDashboard($language, $menu); - $tables = $this->getTableTables($module->getVar('mod_id'), 'table_order ASC, table_name'); + $tables = $this->getTableTables($module->getVar('mod_id'), 'table_order'); foreach (array_keys($tables) as $t) { $tablePermissions = $tables[$t]->getVar('table_permissions'); if (1 == $tables[$t]->getVar('table_admin')) { Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/language/LanguageModinfo.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/language/LanguageModinfo.php 2015-06-12 21:33:08 UTC (rev 13087) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/language/LanguageModinfo.php 2015-06-13 14:20:13 UTC (rev 13088) @@ -106,7 +106,7 @@ */ private function getLanguageMenu($module, $language, $table) { - $tables = $this->getTableTables($module->getVar('mod_id'), 'table_order ASC, table_name'); + $tables = $this->getTableTables($module->getVar('mod_id'), 'table_order'); $menu = 1; $ret = $this->defines->getAboveHeadDefines('Admin Menu'); $ret .= $this->defines->getDefine($language, "ADMENU{$menu}", "Dashboard"); Deleted: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/TDMCreateHtmlSmartyCodes.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/TDMCreateHtmlSmartyCodes.php 2015-06-12 21:33:08 UTC (rev 13087) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/TDMCreateHtmlSmartyCodes.php 2015-06-13 14:20:13 UTC (rev 13088) @@ -1,489 +0,0 @@ -<?php -/* - You may not change or alter any portion of this comment or credits - of supporting developers from this source code or any supporting source code - which is considered copyrighted (c) material of the original comment or credit authors. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - */ -/** - * tdmcreate module - * - * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ - * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) - * @package tdmcreate - * @since 2.5.0 - * @author Txmod Xoops http://www.txmodxoops.org - * @version $Id: htmlsmartycodes.php 12258 2014-01-02 09:33:29Z timgno $ - */ -defined('XOOPS_ROOT_PATH') or die('Restricted access'); - -/** - * Class TDMCreateHtmlSmartyCodes - */ -class TDMCreateHtmlSmartyCodes extends TDMCreateFile -{ - /* - * @public function constructor - * @param null - */ - /** - * - */ - public function __construct() - { - parent::__construct(); - } - - /* - * @static function &getInstance - * @param null - */ - /** - * @return TDMCreateHtmlSmartyCodes - */ - public static function &getInstance() - { - static $instance = false; - if (!$instance) { - $instance = new self(); - } - - return $instance; - } - - /* - * @public function getHtmlDiv - * @param string $class - * @param string $content - */ - /** - * @param string $class - * @param string $content - * @return string - */ - public function getHtmlDiv($class = 'bnone', $content = '') - { - $ret = <<<EOT - <div class='{$class}'> - {$content} - </div> -EOT; - - return $ret; - } - - /* - * @public function getHtmlSpan - * @param string $class - * @param string $content - */ - /** - * @param string $class - * @param string $content - * @return string - */ - public function getHtmlSpan($class = 'bnone', $content = '') - { - $ret = <<<EOT - <span class='{$class}'> - {$content} - </span> -EOT; - - return $ret; - } - - /* - * @public function getHtmlParagraph - * @param string $class - * @param string $content - */ - /** - * @param string $class - * @param string $content - * @return string - */ - public function getHtmlParagraph($class = 'bnone', $content = '') - { - $ret = <<<EOT - <p class='{$class}'> - {$content} - </p> -EOT; - - return $ret; - } - - /* - * @public function getHtmlAnchor - * @param string $class - * @param string $url - * @param string $target - * @param string $content - */ - /** - * @param string $class - * @param string $url - * @param string $target - * @param string $content - * @return string - */ - public function getHtmlAnchor($class = 'bnone', $url = 'http://', $target = '_top', $content = '') - { - $ret = <<<EOT - <a class='{$class}' href='{$url}' target='{$target}'> - {$content} - </a> -EOT; - - return $ret; - } - - /* - * @public function getHtmlImage - * @param string $class - * @param string $src - * @param string $alt - */ - /** - * @param string $class - * @param string $src - * @param string $alt - * @return string - */ - public function getHtmlImage($class = 'bnone', $src = 'blank.gif', $alt = 'blank.gif') - { - $ret = <<<EOT - <img class='{$class}' src='{$src}' alt='{$alt}' /> -EOT; - - return $ret; - } - - /* - * @public function getHtmlTable - * @param string $class - * @param string $content - */ - /** - * @param string $class - * @param string $content - * @return string - */ - public function getHtmlTable($class = 'bnone', $content = '') - { - $ret = <<<EOT - <table class='{$class}'> - {$content} - </table> -EOT; - - return $ret; - } - - /* - * @public function getHtmlTableThead - * @param string $class - * @param string $content - */ - /** - * @param string $class - * @param string $content - * @return string - */ - public function getHtmlTableThead($class = 'bnone', $content = '') - { - $ret = <<<EOT - <thead class='{$class}'> - {$content} - </thead> -EOT; - - return $ret; - } - - /* - * @public function getHtmlTableTbody - * @param string $class - * @param string $content - */ - /** - * @param string $class - * @param string $content - * @return string - */ - public function getHtmlTableTbody($class = 'bnone', $content = '') - { - $ret = <<<EOT - <tbody class='{$class}'> - {$content} - </tbody> -EOT; - - return $ret; - } - - /* - * @public function getHtmlTableTfoot - * @param string $class - * @param string $content - */ - /** - * @param string $class - * @param string $content - * @return string - */ - public function getHtmlTableTfoot($class = 'bnone', $content = '') - { - $ret = <<<EOT - <tfoot class='{$class}'> - {$content} - </tfoot> -EOT; - - return $ret; - } - - /* - * @public function getHtmlTableHead - * @param string $class - * @param string $content - */ - /** - * @param string $class - * @param string $content - * @return string - */ - public function getHtmlTableHead($class = 'bnone', $content = '') - { - $ret = <<<EOT - <th class='{$class}'>{$content}</th> -EOT; - - return $ret; - } - - /* - * @public function getHtmlTableRow - * @param string $class - * @param string $content - */ - /** - * @param string $class - * @param string $content - * @return string - */ - public function getHtmlTableRow($class = 'bnone', $content = '') - { - $ret = <<<EOT - <tr class='{$class}'> - {$content} - </tr> -EOT; - - return $ret; - } - - /* - * @public function getHtmlTableData - * @param string $class - * @param string $content - */ - /** - * @param string $class - * @param string $content - * @return string - */ - public function getHtmlTableData($class = 'bnone', $content = '') - { - $ret = <<<EOT - <td class='{$class}'>{$content}</td> -EOT; - - return $ret; - } - - /* - * @public function getSmartyConst - * @param string $language - * @param mixed $fieldName - */ - /** - * @param $language - * @param $fieldName - * @return string - */ - public function getSmartyConst($language, $fieldName) - { - $ret = <<<EOT - <{\$smarty.const.{$language}{$fieldName}}> -EOT; - - return $ret; - } - - /* - * @public function getSmartyTableFieldNameEmptyData - * @param string $tableName - * @param string $fieldName - */ - /** - * @param string $tableName - * @param string $fieldName - * @return string - */ - public function getSmartyTableFieldNameEmptyData($tableName = '', $fieldName = '') - { - $ret = <<<EOT - <{\${$tableName}.{$fieldName}}> -EOT; - - return $ret; - } - - /* - * @public function getSmartyTableField - * @param string $tableFieldname - * @param string $fieldName - */ - /** - * @param string $tableFieldname - * @param string $fieldName - * @return string - */ - public function getSmartyTableFieldData($tableFieldname = '', $fieldName = '') - { - $ret = <<<EOT - <{\${$tableFieldname}.{$fieldName}}> -EOT; - - return $ret; - } - - /* - * @public function getSmartyIncludeFile - * @param string $name - */ - /** - * @param $moduleDirname - * @param string $tableName - * @return string - */ - public function getSmartyIncludeFile($moduleDirname, $tableName = 'header') - { - $ret = <<<EOT - <{include file='db:{$moduleDirname}_{$tableName}.html'}> -EOT; - - return $ret; - } - - /* - * @public function getSmartyConditions - * @param string $condition - * @param string $operator - * @param string $type - * @param string $content_if - * @param mixed $content_else - */ - /** - * @param string $condition - * @param string $operator - * @param string $type - * @param string $content_if - * @param bool $content_else - * @return string - */ - public function getSmartyConditions($condition = '', $operator = '==', $type = '1', $content_if = '', $content_else = false) - { - if (!$content_else) { - $ret = <<<EOT - <{if ${$condition} {$operator} {$type}'}> - {$content_if} - <{/if}> -EOT; - } else { - $ret = <<<EOT - <{if ${$condition} {$operator} {$type}'}> - {$content_if} - <{else}> - {$content_else} - <{/if}> -EOT; - } - - return $ret; - } - - /* - * @public function getSmartyForeach - * @param string $item - * @param string $from - * @param string $content - */ - /** - * @param string $item - * @param string $from - * @param string $content - * @return string - */ - public function getSmartyForeach($item = 'item', $from = 'from', $content = 'content') - { - $ret = <<<EOT - <{foreach item={$item} from=${$from}}> - {$content} - <{/foreach}> -EOT; - - return $ret; - } - - /* - * @public function getSmartyForeachQuery - * @param string $item - * @param string $from - * @param string $content - */ - /** - * @param string $item - * @param string $from - * @param string $content - * @return string - */ - public function getSmartyForeachQuery($item = 'item', $from = 'from', $content = 'content') - { - $ret = <<<EOT - <{foreachq item={$item} from=${$from}}> - {$content} - <{/foreachq}> -EOT; - - return $ret; - } - - /* - * @public function getSmartySection - * @param string $name - * @param string $loop - * @param string $content - */ - /** - * @param string $name - * @param string $loop - * @param string $content - * @return string - */ - public function getSmartySection($name = 'name', $loop = 'loop', $content = 'content') - { - $ret = <<<EOT - <{section name={$name} loop=${$loop}}> - {$content} - <{/section}> -EOT; - - return $ret; - } -} Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/admin/TemplatesAdminPages.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/admin/TemplatesAdminPages.php 2015-06-12 21:33:08 UTC (rev 13087) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/admin/TemplatesAdminPages.php 2015-06-13 14:20:13 UTC (rev 13088) @@ -298,7 +298,7 @@ $moduleDirname = $module->getVar('mod_dirname'); $tableFieldname = $table->getVar('table_fieldname'); $language = $this->getLanguage($moduleDirname, 'AM'); - $fields = $this->getTableFields($table->getVar('table_mid'), $table->getVar('table_id'), 'field_order ASC'); + $fields = $this->getTableFields($table->getVar('table_mid'), $table->getVar('table_id'), 'field_order'); $content = $this->getTemplatesAdminPagesHeader($moduleDirname, $table, $fields, $language); // Verify if table_fieldname is not empty if (!empty($tableFieldname)) { Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/user/TemplatesUserIndex.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/user/TemplatesUserIndex.php 2015-06-12 21:33:08 UTC (rev 13087) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/user/TemplatesUserIndex.php 2015-06-13 14:20:13 UTC (rev 13088) @@ -110,7 +110,7 @@ <ul class="menu"> <li><a href="<{\${$moduleDirname}_url}>"><{\$smarty.const.{$language}INDEX}></a></li>\n EOT; - $tables = $this->getTableTables($module->getVar('mod_id'), 'table_order ASC'); + $tables = $this->getTableTables($module->getVar('mod_id'), 'table_order'); foreach (array_keys($tables) as $i) { $tableName = $tables[$i]->getVar('table_name'); $stuTableName = strtoupper($tableName); Deleted: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/user/TemplatesUserMoreFiles.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/user/TemplatesUserMoreFiles.php 2015-06-12 21:33:08 UTC (rev 13087) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/user/TemplatesUserMoreFiles.php 2015-06-13 14:20:13 UTC (rev 13088) @@ -1,122 +0,0 @@ -<?php -/* - You may not change or alter any portion of this comment or credits - of supporting developers from this source code or any supporting source code - which is considered copyrighted (c) material of the original comment or credit authors. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - */ -/** - * tdmcreate module - * - * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ - * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) - * @package tdmcreate - * @since 2.5.0 - * @author Txmod Xoops http://www.txmodxoops.org - * @version $Id: TemplatesUserMoreFiles.php 12258 2014-01-02 09:33:29Z timgno $ - */ -defined('XOOPS_ROOT_PATH') or die('Restricted access'); - -/** - * Class TemplatesUserMoreFiles - */ -class TemplatesUserMoreFiles extends TDMCreateFile -{ - // - private $folder; - // - private $extension; - /* - * @public function constructor - * @param null - */ - /** - * - */ - public function __construct() - { - parent::__construct(); - $this->tdmcfile = TDMCreateFile::getInstance(); - } - - /* - * @static function &getInstance - * @param null - */ - /** - * @return TemplatesUserMoreFiles - */ - public static function &getInstance() - { - static $instance = false; - if (!$instance) { - $instance = new self(); - } - - return $instance; - } - - /* - * @public function write - * @param string $module - * @param string $filename - */ - /** - * @param $module - * @param $filename - * @return string - */ - public function write($module, $folder = '', $filename, $extension) - { - $this->setModule($module); - $this->setFileName($filename); - if($folder != ''){ - $this->folder = 'templates/'.$folder; - } else { - $this->folder = 'templates'; - } - $this->extension = $extension; - } - - /* - * @private function getTemplatesUserMoreFile - * @param null - */ - /** - * @param null - * @return string - */ - private function getTemplatesUserMoreFile() - { - $ret = <<<EOT -<div class="panel"> - Pleace! Enter here your template code here -</div> -EOT; - - return $ret; - } - - /* - * @public function renderFile - * @param string $filename - */ - /** - * @param $filename - * @return bool|string - */ - public function renderFile() - { - $module = $this->getModule(); - $filename = $this->getFileName(); - $moduleDirname = $module->getVar('mod_dirname'); - $content = $this->getTemplatesUserMoreFile(); - // - $this->tdmcfile->create($moduleDirname, $this->folder, $filename . '.' . $this->extension, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED); - - return $this->tdmcfile->renderFile(); - } -} |
From: <txm...@us...> - 2015-06-13 22:09:39
|
Revision: 13089 http://sourceforge.net/p/xoops/svn/13089 Author: txmodxoops Date: 2015-06-13 22:09:36 +0000 (Sat, 13 Jun 2015) Log Message: ----------- Merged modifies (With Goffy) Modified Paths: -------------- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/fields.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/index.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/tables.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/language/english/admin.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/language/english/modinfo.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/xoops_version.php Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/fields.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/fields.php 2015-06-13 14:20:13 UTC (rev 13088) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/fields.php 2015-06-13 22:09:36 UTC (rev 13089) @@ -172,7 +172,7 @@ // Set field elements if ($fieldsObj->isNew()) { // Fields Elements Handler - $fieldelementObj =& $tdmcreate->getHandler('fieldelements')->create(); + /*$fieldelementObj =& $tdmcreate->getHandler('fieldelements')->create(); $fieldelementObj->setVar( 'fieldelement_mid', $fieldMid ); $fieldelementObj->setVar( 'fieldelement_tid', $fieldTid ); $fieldelementObj->setVar( 'fieldelement_name', 'Table : '.ucfirst($tableName) ); @@ -180,7 +180,7 @@ // Insert new field element id for table name if (!$tdmcreate->getHandler('fieldelements')->insert($fieldelementObj) ) { $GLOBALS['xoopsTpl']->assign('error', $fieldelementObj->getHtmlErrors() . ' Field element'); - } + }*/ redirect_header('fields.php', 2, sprintf(_AM_TDMCREATE_FIELDS_FORM_SAVED_OK, $tableName)); } else { // Needed code from table name by field_tid Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/index.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/index.php 2015-06-13 14:20:13 UTC (rev 13088) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/index.php 2015-06-13 22:09:36 UTC (rev 13089) @@ -19,16 +19,17 @@ * @version $Id: index.php 11084 2013-02-23 15:44:20Z timgno $ */ include __DIR__ . '/header.php'; -$criteria = new CriteriaCompo(); -$count_modules = $tdmcreate->getHandler('modules')->getCount($criteria); -$count_tables = $tdmcreate->getHandler('tables')->getCount($criteria); -$count_fields = $tdmcreate->getHandler('fields')->getCount($criteria); +$countModules = $tdmcreate->getHandler('modules')->getCount(); +$countTables = $tdmcreate->getHandler('tables')->getCount(); +$countFields = $tdmcreate->getHandler('fields')->getCount(); +$countFiles = $tdmcreate->getHandler('morefiles')->getCount(); unset($criteria); $templateMain = 'tdmcreate_index.tpl'; $adminMenu->addInfoBox(_AM_TDMCREATE_ADMIN_NUMMODULES); -$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, '<label>' . _AM_TDMCREATE_THEREARE_NUMMODULES . '</label>', $count_modules, 'Green'); -$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, '<label>' . _AM_TDMCREATE_THEREARE_NUMTABLES . '</label>', $count_tables, 'Orange'); -$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, '<label>' . _AM_TDMCREATE_THEREARE_NUMFIELDS . '</label>', $count_fields, 'Gray'); +$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, '<label>' . _AM_TDMCREATE_THEREARE_NUMMODULES . '</label>', $countModules, 'Green'); +$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, '<label>' . _AM_TDMCREATE_THEREARE_NUMTABLES . '</label>', $countTables, 'Orange'); +$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, '<label>' . _AM_TDMCREATE_THEREARE_NUMFIELDS . '</label>', $countFields, 'Gray'); +$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, '<label>' . _AM_TDMCREATE_THEREARE_NUMFILES . '</label>', $countFiles, 'Red'); // Upload Folders $folder = array( Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/tables.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/tables.php 2015-06-13 14:20:13 UTC (rev 13088) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/tables.php 2015-06-13 22:09:36 UTC (rev 13089) @@ -22,7 +22,7 @@ // Recovered value of arguments op in the URL $ $op = XoopsRequest::getString('op', 'list'); // -$mod_id = XoopsRequest::getInt('mod_id'); +$modId = XoopsRequest::getInt('mod_id'); // Request vars $tableId = XoopsRequest::getInt('table_id'); $tableMid = XoopsRequest::getInt('table_mid'); @@ -186,6 +186,16 @@ if ($tablesObj->isNew()) { $tableTid = $GLOBALS['xoopsDB']->getInsertId(); $tableAction = '&field_mid=' . $tableMid . '&field_tid=' . $tableTid . '&field_numb=' . $tableNumbFields . '&field_name=' . $tableFieldname; + // Fields Elements Handler + $fieldelementObj =& $tdmcreate->getHandler('fieldelements')->create(); + $fieldelementObj->setVar( 'fieldelement_mid', $tableMid ); + $fieldelementObj->setVar( 'fieldelement_tid', $tableTid ); + $fieldelementObj->setVar( 'fieldelement_name', 'Table : '.ucfirst($_POST['table_name']) ); + $fieldelementObj->setVar( 'fieldelement_value', 'XoopsFormTables-'.ucfirst($_POST['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?op=new' . $tableAction, 5, sprintf(_AM_TDMCREATE_TABLE_FORM_CREATED_OK, $_POST['table_name'])); } else { redirect_header('tables.php', 5, sprintf(_AM_TDMCREATE_TABLE_FORM_UPDATED_OK, $_POST['table_name'])); @@ -238,9 +248,18 @@ redirect_header('tables.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors())); } if ($tdmcreate->getHandler('tables')->delete($tablesObj)) { + // Delete items in table fieldelements - idea by goffy + $fieldelements = $tdmcreate->getHandler('fieldelements')->getAllFieldElementsByModuleAndTableId($tableMid, $tableId); + foreach (array_keys($fieldelements) as $fe) { + $fieldelementsObj =& $tdmcreate->getHandler('fieldelements')->get($fieldelements[$fe]->getVar('fieldelement_id')); + if (!$tdmcreate->getHandler('fieldelements')->delete($fieldelementsObj)) { + $GLOBALS['xoopsTpl']->assign('error', $fieldelementsObj->getHtmlErrors()); + } + unset($fieldelementsObj); + } redirect_header('tables.php', 3, _AM_TDMCREATE_FORMDELOK); } else { - echo $tablesObj->getHtmlErrors(); + $GLOBALS['xoopsTpl']->assign('error', $tablesObj->getHtmlErrors()); } } else { xoops_confirm(array('ok' => 1, 'table_id' => $tableId, 'op' => 'delete'), $_SERVER['REQUEST_URI'], sprintf(_AM_TDMCREATE_FORMSUREDEL, $tablesObj->getVar('table_name'))); Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/language/english/admin.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/language/english/admin.php 2015-06-13 14:20:13 UTC (rev 13088) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/language/english/admin.php 2015-06-13 22:09:36 UTC (rev 13089) @@ -30,6 +30,7 @@ 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_THEREARE_NUMFILES', "There are <span class='red bold'>%s</span> more files stored in the Database"); // General define('_AM_TDMCREATE_FORMOK', "Successfully saved"); define('_AM_TDMCREATE_FORMDELOK', "Successfully deleted"); Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/language/english/modinfo.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/language/english/modinfo.php 2015-06-13 14:20:13 UTC (rev 13088) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/language/english/modinfo.php 2015-06-13 22:09:36 UTC (rev 13089) @@ -89,3 +89,4 @@ define('_MI_TDMCREATE_CONFIG_MODULES_ADMINPAGER', "Modules adminpager"); define('_MI_TDMCREATE_CONFIG_TABLES_ADMINPAGER', "Tables adminpager"); define('_MI_TDMCREATE_CONFIG_FIELDS_ADMINPAGER', "Fields adminpager"); +define('_MI_TDMCREATE_CONFIG_MOREFILES_ADMINPAGER', "More Files adminpager"); Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/xoops_version.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/xoops_version.php 2015-06-13 14:20:13 UTC (rev 13088) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/xoops_version.php 2015-06-13 22:09:36 UTC (rev 13089) @@ -27,7 +27,7 @@ $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['credits'] = "Mamba(Xoops), Timgno(Txmod Xoops), Goffy(German Xoops)"; $modversion['help'] = "page=help"; $modversion['license'] = "GNU GPL 2.0 or later"; $modversion['license_url'] = "www.gnu.org/licenses/gpl-2.0.html/"; |
From: <txm...@us...> - 2015-07-03 12:44:49
|
Revision: 13095 http://sourceforge.net/p/xoops/svn/13095 Author: txmodxoops Date: 2015-07-03 12:44:44 +0000 (Fri, 03 Jul 2015) Log Message: ----------- Fixed small bugs Refactoring Updated Modified Paths: -------------- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/about.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/building.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/fields.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/footer.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/header.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/index.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/menu.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/modules.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/morefiles.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/settings.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/tables.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/assets/css/admin/style.css XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/assets/js/functions.js XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/SplClassLoader.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/autoload.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/building.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/fieldattributes.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/fieldelements.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/fieldkey.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/fieldnull.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/fields.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/fieldtype.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateAbstract.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateArchitecture.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateFile.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateHtmlSmartyCodes.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateMoreFiles.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateStructure.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreateTableFields.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/admin/AdminAbout.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/admin/AdminFooter.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/admin/AdminHeader.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/admin/AdminIndex.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/admin/AdminMenu.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/admin/AdminObjects.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/admin/AdminPages.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/admin/AdminPermissions.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/admin/AdminPhpCode.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/blocks/BlocksFiles.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/classes/ClassFiles.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/classes/ClassFormElements.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/classes/ClassHelper.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/css/CssStyles.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/docs/DocsChangelog.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/docs/DocsFiles.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/include/IncludeCommentFunctions.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/include/IncludeComments.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/include/IncludeCommon.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/include/IncludeFunctions.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/include/IncludeInstall.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/include/IncludeJquery.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/include/IncludeNotifications.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/include/IncludeSearch.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/include/IncludeUpdate.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/language/LanguageAdmin.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/language/LanguageBlocks.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/language/LanguageDefines.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/language/LanguageHelp.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/language/LanguageMailTpl.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/language/LanguageMain.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/language/LanguageModinfo.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/sql/SqlFile.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/admin/TemplatesAdminAbout.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/admin/TemplatesAdminFooter.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/admin/TemplatesAdminHeader.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/admin/TemplatesAdminIndex.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/admin/TemplatesAdminPages.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/admin/TemplatesAdminPermissions.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/blocks/TemplatesBlocks.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/user/TemplatesUserBreadcrumbs.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/user/TemplatesUserBroken.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/user/TemplatesUserDisqusComments.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/user/TemplatesUserFacebookComments.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/user/TemplatesUserFooter.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/user/TemplatesUserHeader.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/user/TemplatesUserIndex.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/user/TemplatesUserPages.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/user/TemplatesUserPagesList.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/user/TemplatesUserPdf.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/user/TemplatesUserPrint.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/user/TemplatesUserRate.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/user/TemplatesUserRss.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/user/TemplatesUserSearch.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/user/TemplatesUserSingle.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/user/TemplatesUserSubmit.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/user/UserBroken.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/user/UserFooter.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/user/UserHeader.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/user/UserIndex.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/user/UserListTag.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/user/UserNotificationUpdate.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/user/UserObjects.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/user/UserPages.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/user/UserPdf.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/user/UserPrint.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/user/UserRate.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/user/UserRss.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/user/UserSearch.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/user/UserSingle.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/user/UserSubmit.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/user/UserViewTag.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/user/UserVisit.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/user/UserXoopsVersion.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/form/TDMCreateFormRadio.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/form/TDMCreateFormRaw.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/form/TDMCreateFormTab.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/form/TDMCreateFormTabTray.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/form/TDMCreateThemeForm.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/helper.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/html/TDMCreateFormLabel.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/logoGenerator.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/modules.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/morefiles.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/session.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/settings.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/tables.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/include/common.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/include/functions.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/include/install.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/include/update.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/language/english/admin.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/language/english/modinfo.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/sql/mysql.sql XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/templates/admin/tdmcreate_settings.tpl XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/templates/admin/tdmcreate_tables.tpl XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/xoops_version.php Added Paths: ----------- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/TDMCreatePhpCode.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/user/TemplatesUserCategories.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/user/TemplatesUserCategoriesList.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/files/templates/user/TemplatesUserMoreFiles.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/language/lang.diff Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/about.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/about.php 2015-07-01 10:38:11 UTC (rev 13094) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/about.php 2015-07-03 12:44:44 UTC (rev 13095) @@ -1,4 +1,5 @@ <?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 @@ -9,19 +10,21 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ /** - * tdmcreate module + * 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 __DIR__ . '/header.php'; +include __DIR__.'/header.php'; $templateMain = 'tdmcreate_about.tpl'; $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('about.php')); -$about = $adminMenu->renderAbout('7LFE862PGJN88', false); +$about = $adminMenu->renderAbout('7LFE862PGJN88', false); $aboutRes = TDMCreate_MakeDonationForm($about); $GLOBALS['xoopsTpl']->assign('about', $aboutRes); -include __DIR__ . '/footer.php'; +include __DIR__.'/footer.php'; Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/building.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/building.php 2015-07-01 10:38:11 UTC (rev 13094) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/building.php 2015-07-03 12:44:44 UTC (rev 13095) @@ -1,4 +1,5 @@ <?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 @@ -9,26 +10,29 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ /** - * tdmcreate module + * 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 __DIR__ . '/header.php'; -$op = XoopsRequest::getString('op', 'default'); -$mid = XoopsRequest::getInt('mod_id'); +include __DIR__.'/header.php'; +$op = XoopsRequest::getString('op', 'default'); +$mid = XoopsRequest::getInt('mod_id'); $moduleObj = $tdmcreate->getHandler('modules')->get($mid); +$cachePath = XOOPS_VAR_PATH.'/caches/tdmcreate_cache'; // Clear cache -if (file_exists($cacheFile1 = TDMC_CLASSES_PATH . '/cache/classpaths.cache') && - file_exists($cacheFile2 = TDMC_CLASSES_PATH . '/files/cache/classpaths.cache')) { - if (unlink($cacheFile1) && unlink($cacheFile2)) { - redirect_header('building.php?op=build', 5, _AM_TDMCREATE_BUILDING_DELETED_CACHE_FILES); - } +if (file_exists($cache = $cachePath.'/classpaths.cache')) { + unlink($cache); } +if (!file_exists($indexFile = $cachePath.'/index.html')) { + copy('index.html', $indexFile); +} // Switch option switch ($op) { case 'build': @@ -37,8 +41,8 @@ // 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); + $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)) { @@ -50,11 +54,11 @@ } } // Structure - include_once TDMC_CLASSES_PATH . '/files/TDMCreateArchitecture.php'; + include_once TDMC_CLASSES_PATH.'/files/TDMCreateArchitecture.php'; $handler = TDMCreateArchitecture::getInstance(); // Creation of the structure of folders and files - $base_architecture = $handler->createBaseFoldersFiles($moduleObj); - if (false !== $base_architecture) { + $baseArchitecture = $handler->createBaseFoldersFiles($moduleObj); + if (false !== $baseArchitecture) { $GLOBALS['xoopsTpl']->assign('base_architecture', true); } else { $GLOBALS['xoopsTpl']->assign('base_architecture', false); @@ -65,8 +69,8 @@ foreach ($files as $file) { if ($file) { $build['list'] = $file; - } - $GLOBALS['xoopsTpl']->append('builds', $build); + $GLOBALS['xoopsTpl']->append('builds', $build); + } } unset($build); // Directory to saved all files @@ -87,10 +91,10 @@ redirect_header('modules.php?op=new', 2, _AM_TDMCREATE_NOTMODULES); } unset($nbModules); - include_once TDMC_PATH . '/class/building.php'; + include_once TDMC_PATH.'/class/building.php'; $handler = TDMCreateBuilding::getInstance(); - $form = $handler->getForm(); + $form = $handler->getForm(); $GLOBALS['xoopsTpl']->assign('form', $form->render()); break; } -include __DIR__ . '/footer.php'; +include __DIR__.'/footer.php'; Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/fields.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/fields.php 2015-07-01 10:38:11 UTC (rev 13094) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/fields.php 2015-07-03 12:44:44 UTC (rev 13095) @@ -1,4 +1,5 @@ -<?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 @@ -9,16 +10,18 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ /** - * tdmcreate module + * 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 __DIR__ . '/header.php'; +include __DIR__.'/header.php'; // Recovered value of arguments op in the URL $ $op = XoopsRequest::getString('op', 'list'); // Get fields Variables @@ -27,187 +30,167 @@ $fieldNumb = XoopsRequest::getInt('field_numb'); $fieldName = XoopsRequest::getString('field_name', ''); // switch op -switch ($op) -{ - case 'list': +switch ($op) { + case 'list': default: $start = XoopsRequest::getInt('start', 0); - $limit = XoopsRequest::getInt('limit', $tdmcreate->getConfig('tables_adminpager')); - // Define main template - $templateMain = 'tdmcreate_fields.tpl'; - $GLOBALS['xoTheme']->addStylesheet( 'modules/tdmcreate/assets/css/admin/style.css' ); - $GLOBALS['xoTheme']->addScript('browse.php?Frameworks/jquery/plugins/jquery.ui.js'); - $GLOBALS['xoTheme']->addScript('modules/tdmcreate/assets/js/functions.js'); - $GLOBALS['xoTheme']->addScript('modules/tdmcreate/assets/js/sortable.js'); - $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('fields.php')); - $adminMenu->addItemButton(_AM_TDMCREATE_ADD_TABLE, 'tables.php?op=new', 'add'); - $GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton()); - $GLOBALS['xoopsTpl']->assign('tdmc_url', TDMC_URL); - $GLOBALS['xoopsTpl']->assign('tdmc_icons_url', TDMC_ICONS_URL); - $GLOBALS['xoopsTpl']->assign('tdmc_upload_url', TDMC_UPLOAD_URL); - $GLOBALS['xoopsTpl']->assign('tdmc_upload_imgtab_url', TDMC_UPLOAD_IMGTAB_URL); - $GLOBALS['xoopsTpl']->assign('modPathIcon16', $modPathIcon16); - $GLOBALS['xoopsTpl']->assign('sysPathIcon32', $sysPathIcon32); - // Redirect if there aren't modules - $modulesCount = $tdmcreate->getHandler('modules')->getCountModules(); - if ( $modulesCount == 0 ) { - redirect_header('modules.php?op=new', 2, _AM_TDMCREATE_NOTMODULES ); - } - unset($modulesCount); - // Redirect if there aren't tables - $tablesCount = $tdmcreate->getHandler('tables')->getCountTables(); - if ($tablesCount == 0) { - redirect_header('tables.php?op=new', 2, _AM_TDMCREATE_NOTTABLES ); - } - // Get the list of tables - $tablesAll = $tdmcreate->getHandler('tables')->getAllTables($start, $limit); - if ($tablesCount > 0) - { - $tlid = 1; - foreach (array_keys($tablesAll) as $tid) - { - // Display tables list - $table = $tablesAll[$tid]->getValues(); - $talid = array('lid' => $tlid); - $table = array_merge($table, $talid); + $limit = XoopsRequest::getInt('limit', $tdmcreate->getConfig('tables_adminpager')); + // Define main template + $templateMain = 'tdmcreate_fields.tpl'; + $GLOBALS['xoTheme']->addStylesheet('modules/tdmcreate/assets/css/admin/style.css'); + $GLOBALS['xoTheme']->addScript('browse.php?Frameworks/jquery/plugins/jquery.ui.js'); + $GLOBALS['xoTheme']->addScript('modules/tdmcreate/assets/js/functions.js'); + $GLOBALS['xoTheme']->addScript('modules/tdmcreate/assets/js/sortable.js'); + $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('fields.php')); + $adminMenu->addItemButton(_AM_TDMCREATE_ADD_TABLE, 'tables.php?op=new', 'add'); + $GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton()); + $GLOBALS['xoopsTpl']->assign('modPathIcon16', TDMC_URL.'/'.$modPathIcon16); + // Redirect if there aren't modules + $modulesCount = $tdmcreate->getHandler('modules')->getCountModules(); + if ($modulesCount == 0) { + redirect_header('modules.php?op=new', 2, _AM_TDMCREATE_NOTMODULES); + } + unset($modulesCount); + // Redirect if there aren't tables + $tablesCount = $tdmcreate->getHandler('tables')->getCountTables(); + if ($tablesCount == 0) { + redirect_header('tables.php?op=new', 2, _AM_TDMCREATE_NOTTABLES); + } + // Get the list of tables + $tablesAll = $tdmcreate->getHandler('tables')->getAllTables($start, $limit); + if ($tablesCount > 0) { + $tlid = 1; + foreach (array_keys($tablesAll) as $tid) { + // Display tables list + $table = $tablesAll[$tid]->getValues(); + $talid = array('lid' => $tlid); + $table = array_merge($table, $talid); // Get the list of fields - $fieldsCount = $tdmcreate->getHandler('fields')->getCountFields(); - $fieldsAll = $tdmcreate->getHandler('fields')->getAllFieldsByModuleAndTableId($table['mid'], $tid); - // Display fields list - $fields = array(); - $lid = 1; - if ( $fieldsCount > 0 ) - { - foreach (array_keys($fieldsAll) as $fid) - { - $field = $fieldsAll[$fid]->getValues(); - $falid = array('lid' => $lid); - $fields[] = array_merge($field, $falid); - unset($field); - ++$lid; - } - } - ++$tlid; - unset($lid); - $table['fields'] = $fields; - $GLOBALS['xoopsTpl']->append('tables_list', $table); - unset($table); - } - unset($tlid); - unset($fields); - if ( $tablesCount > $limit ) { - include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; - $pagenav = new XoopsPageNav($tablesCount, $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 - $templateMain = 'tdmcreate_fields.tpl'; - $GLOBALS['xoTheme']->addStylesheet( 'modules/tdmcreate/assets/css/admin/style.css' ); - $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('fields.php')); - $adminMenu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php', 'list'); - $adminMenu->addItemButton(_AM_TDMCREATE_FIELDS_LIST, 'fields.php', 'list'); - $GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton()); - // Form Add - $fieldsObj =& $tdmcreate->getHandler('fields')->create(); - $form = $fieldsObj->getFormNew($fieldMid, $fieldTid, $fieldNumb, $fieldName); - $GLOBALS['xoopsTpl']->assign('form', $form->render()); - break; - - case 'save': - // - if ( !$GLOBALS['xoopsSecurity']->check() ) { + $fieldsCount = $tdmcreate->getHandler('fields')->getCountFields(); + $fieldsAll = $tdmcreate->getHandler('fields')->getAllFieldsByModuleAndTableId($table['mid'], $tid); + // Display fields list + $fields = array(); + $lid = 1; + if ($fieldsCount > 0) { + foreach (array_keys($fieldsAll) as $fid) { + $field = $fieldsAll[$fid]->getValues(); + $falid = array('lid' => $lid); + $fields[] = array_merge($field, $falid); + unset($field); + ++$lid; + } + } + ++$tlid; + unset($lid); + $table['fields'] = $fields; + $GLOBALS['xoopsTpl']->append('tables_list', $table); + unset($table); + } + unset($tlid); + unset($fields); + if ($tablesCount > $limit) { + include_once XOOPS_ROOT_PATH.'/class/pagenav.php'; + $pagenav = new XoopsPageNav($tablesCount, $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 + $templateMain = 'tdmcreate_fields.tpl'; + $GLOBALS['xoTheme']->addStylesheet('modules/tdmcreate/assets/css/admin/style.css'); + $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('fields.php')); + $adminMenu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php', 'list'); + $adminMenu->addItemButton(_AM_TDMCREATE_FIELDS_LIST, 'fields.php', 'list'); + $GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton()); + // Form Add + $fieldsObj = &$tdmcreate->getHandler('fields')->create(); + $form = $fieldsObj->getFormNew($fieldMid, $fieldTid, $fieldNumb, $fieldName); + $GLOBALS['xoopsTpl']->assign('form', $form->render()); + break; + + case 'save': + // + if (!$GLOBALS['xoopsSecurity']->check()) { redirect_header('fields.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors())); - } - $fieldId = XoopsRequest::getInt('field_id'); - // Fields Handler - $fields = $tdmcreate->getHandler('fields'); - $fieldOrder = 1; - // Set Variables - foreach($_POST['field_id'] as $key => $value) - { - if(isset($value)){ - $fieldsObj =& $fields->get($value); - } else { - $fieldsObj =& $fields->create(); - } - $order = $fieldsObj->isNew() ? $fieldOrder : $_GET['field_order'][$key]; - // Set Data - $fieldsObj->setVar( 'field_mid', $fieldMid ); - $fieldsObj->setVar( 'field_tid', $fieldTid ); - $fieldsObj->setVar( 'field_order', $order ); - $fieldsObj->setVar( 'field_name', $_POST['field_name'][$key]); - $fieldsObj->setVar( 'field_type', $_POST['field_type'][$key]); - $fieldsObj->setVar( 'field_value', $_POST['field_value'][$key]); - $fieldsObj->setVar( 'field_attribute', $_POST['field_attribute'][$key]); - $fieldsObj->setVar( 'field_null', $_POST['field_null'][$key]); - $fieldsObj->setVar( 'field_default', $_POST['field_default'][$key]); - $fieldsObj->setVar( 'field_key', $_POST['field_key'][$key]); - $fieldsObj->setVar( 'field_element', $_POST['field_element'][$key]); - $fieldsObj->setVar( 'field_parent', (1 == $_REQUEST['field_parent'][$key]) ? 1 : 0); - $fieldsObj->setVar( 'field_admin', (1 == $_REQUEST['field_admin'][$key]) ? 1 : 0); - $fieldsObj->setVar( 'field_inlist', (1 == $_REQUEST['field_inlist'][$key]) ? 1 : 0); - $fieldsObj->setVar( 'field_inform', (1 == $_REQUEST['field_inform'][$key]) ? 1 : 0); - $fieldsObj->setVar( 'field_user', (1 == $_REQUEST['field_user'][$key]) ? 1 : 0); - $fieldsObj->setVar( 'field_thead', (1 == $_REQUEST['field_thead'][$key]) ? 1 : 0); - $fieldsObj->setVar( 'field_tbody', (1 == $_REQUEST['field_tbody'][$key]) ? 1 : 0); - $fieldsObj->setVar( 'field_tfoot', (1 == $_REQUEST['field_tfoot'][$key]) ? 1 : 0); - $fieldsObj->setVar( 'field_block', (1 == $_REQUEST['field_block'][$key]) ? 1 : 0); - $fieldsObj->setVar( 'field_main', ($key == $_REQUEST['field_main'] ? 1 : 0)); - $fieldsObj->setVar( 'field_search', (1 == $_REQUEST['field_search'][$key]) ? 1 : 0); - $fieldsObj->setVar( 'field_required', (1 == $_REQUEST['field_required'][$key]) ? 1 : 0); - // Insert Data - $tdmcreate->getHandler('fields')->insert($fieldsObj); - ++$fieldOrder; - } - unset($fieldOrder); - // Get table name from field table id - $tables =& $tdmcreate->getHandler('tables')->get($fieldTid); - $tableName = $tables->getVar('table_name'); - // Set field elements - if ($fieldsObj->isNew()) { - // Fields Elements Handler - /*$fieldelementObj =& $tdmcreate->getHandler('fieldelements')->create(); - $fieldelementObj->setVar( 'fieldelement_mid', $fieldMid ); - $fieldelementObj->setVar( 'fieldelement_tid', $fieldTid ); - $fieldelementObj->setVar( 'fieldelement_name', 'Table : '.ucfirst($tableName) ); - $fieldelementObj->setVar( 'fieldelement_value', 'XoopsFormTables-'.ucfirst($tableName) ); - // Insert new field element id for table name - if (!$tdmcreate->getHandler('fieldelements')->insert($fieldelementObj) ) { - $GLOBALS['xoopsTpl']->assign('error', $fieldelementObj->getHtmlErrors() . ' Field element'); - }*/ - redirect_header('fields.php', 2, sprintf(_AM_TDMCREATE_FIELDS_FORM_SAVED_OK, $tableName)); - } else { - // Needed code from table name by field_tid - redirect_header('fields.php', 2, sprintf(_AM_TDMCREATE_FIELDS_FORM_UPDATED_OK, $tableName)); - } + } + $fieldId = XoopsRequest::getInt('field_id'); + // Fields Handler + $fields = $tdmcreate->getHandler('fields'); + $fieldOrder = 1; + // Set Variables + foreach ($_POST['field_id'] as $key => $value) { + if (isset($value)) { + $fieldsObj = &$fields->get($value); + } else { + $fieldsObj = &$fields->create(); + } + $order = $fieldsObj->isNew() ? $fieldOrder : $_GET['field_order'][$key]; + // Set Data + $fieldsObj->setVar('field_mid', $fieldMid); + $fieldsObj->setVar('field_tid', $fieldTid); + $fieldsObj->setVar('field_order', $order); + $fieldsObj->setVar('field_name', $_POST['field_name'][$key]); + $fieldsObj->setVar('field_type', $_POST['field_type'][$key]); + $fieldsObj->setVar('field_value', $_POST['field_value'][$key]); + $fieldsObj->setVar('field_attribute', $_POST['field_attribute'][$key]); + $fieldsObj->setVar('field_null', $_POST['field_null'][$key]); + $fieldsObj->setVar('field_default', $_POST['field_default'][$key]); + $fieldsObj->setVar('field_key', $_POST['field_key'][$key]); + $fieldsObj->setVar('field_element', $_POST['field_element'][$key]); + $fieldsObj->setVar('field_parent', (1 == $_REQUEST['field_parent'][$key]) ? 1 : 0); + $fieldsObj->setVar('field_admin', (1 == $_REQUEST['field_admin'][$key]) ? 1 : 0); + $fieldsObj->setVar('field_inlist', (1 == $_REQUEST['field_inlist'][$key]) ? 1 : 0); + $fieldsObj->setVar('field_inform', (1 == $_REQUEST['field_inform'][$key]) ? 1 : 0); + $fieldsObj->setVar('field_user', (1 == $_REQUEST['field_user'][$key]) ? 1 : 0); + $fieldsObj->setVar('field_thead', (1 == $_REQUEST['field_thead'][$key]) ? 1 : 0); + $fieldsObj->setVar('field_tbody', (1 == $_REQUEST['field_tbody'][$key]) ? 1 : 0); + $fieldsObj->setVar('field_tfoot', (1 == $_REQUEST['field_tfoot'][$key]) ? 1 : 0); + $fieldsObj->setVar('field_block', (1 == $_REQUEST['field_block'][$key]) ? 1 : 0); + $fieldsObj->setVar('field_main', ($key == $_REQUEST['field_main'] ? 1 : 0)); + $fieldsObj->setVar('field_search', (1 == $_REQUEST['field_search'][$key]) ? 1 : 0); + $fieldsObj->setVar('field_required', (1 == $_REQUEST['field_required'][$key]) ? 1 : 0); + // Insert Data + $tdmcreate->getHandler('fields')->insert($fieldsObj); + ++$fieldOrder; + } + unset($fieldOrder); + // Get table name from field table id + $tables = &$tdmcreate->getHandler('tables')->get($fieldTid); + $tableName = $tables->getVar('table_name'); + // Set field elements + if ($fieldsObj->isNew()) { + // Fields Elements Handler + redirect_header('fields.php', 2, sprintf(_AM_TDMCREATE_FIELDS_FORM_SAVED_OK, $tableName)); + } else { + // Needed code from table name by field_tid + redirect_header('fields.php', 2, sprintf(_AM_TDMCREATE_FIELDS_FORM_UPDATED_OK, $tableName)); + } // - $GLOBALS['xoopsTpl']->assign('error', $fieldsObj->getHtmlErrors()); - $form = $fieldsObj->getForm(null, $fieldTid); - $GLOBALS['xoopsTpl']->assign('form', $form->render()); - break; - - case 'edit': - // Define main template - $templateMain = 'tdmcreate_fields.tpl'; - $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('fields.php')); - $adminMenu->addItemButton(_AM_TDMCREATE_ADD_TABLE, 'tables.php?op=new', 'add'); - $adminMenu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php', 'list'); - $adminMenu->addItemButton(_AM_TDMCREATE_FIELDS_LIST, 'fields.php', 'list'); - $GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton()); - // Form Edit - $fieldId = XoopsRequest::getInt('field_id'); - $fieldsObj = $tdmcreate->getHandler('fields')->get( $fieldId ); - $form = $fieldsObj->getFormEdit($fieldMid, $fieldTid); - $GLOBALS['xoopsTpl']->assign('form', $form->render()); - break; - - case 'order': + $GLOBALS['xoopsTpl']->assign('error', $fieldsObj->getHtmlErrors()); + $form = $fieldsObj->getForm(null, $fieldTid); + $GLOBALS['xoopsTpl']->assign('form', $form->render()); + break; + + case 'edit': + // Define main template + $templateMain = 'tdmcreate_fields.tpl'; + $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('fields.php')); + $adminMenu->addItemButton(_AM_TDMCREATE_ADD_TABLE, 'tables.php?op=new', 'add'); + $adminMenu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php', 'list'); + $adminMenu->addItemButton(_AM_TDMCREATE_FIELDS_LIST, 'fields.php', 'list'); + $GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton()); + // Form Edit + $fieldId = XoopsRequest::getInt('field_id'); + $fieldsObj = $tdmcreate->getHandler('fields')->get($fieldId); + $form = $fieldsObj->getFormEdit($fieldMid, $fieldTid); + $GLOBALS['xoopsTpl']->assign('form', $form->render()); + break; + + case 'order': // Initialize fields handler $fieldsObj = $tdmcreate->getHandler('fields'); if (isset($_POST['forder'])) { @@ -228,67 +211,67 @@ exit; break; - case 'delete': - $tablesObj =& $tdmcreate->getHandler('tables')->get($fieldTid); - if (isset($_REQUEST['ok']) && $_REQUEST['ok'] == 1) { - if ( !$GLOBALS['xoopsSecurity']->check() ) { - redirect_header('fields.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors())); - } - if ($tdmcreate->getHandler('tables')->delete($tablesObj)) { - redirect_header('fields.php', 3, _AM_TDMCREATE_FORMDELOK); - } else { - echo $tablesObj->getHtmlErrors(); - } - } else { - xoops_confirm(array('ok' => 1, 'field_tid' => $fieldTid, 'op' => 'delete'), $_SERVER['REQUEST_URI'], sprintf(_AM_TDMCREATE_FORMSUREDEL, $tablesObj->getVar('table_name'))); - } - break; - - case 'display': + case 'delete': + $tablesObj = &$tdmcreate->getHandler('tables')->get($fieldTid); + if (isset($_REQUEST['ok']) && $_REQUEST['ok'] == 1) { + if (!$GLOBALS['xoopsSecurity']->check()) { + redirect_header('fields.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors())); + } + if ($tdmcreate->getHandler('tables')->delete($tablesObj)) { + redirect_header('fields.php', 3, _AM_TDMCREATE_FORMDELOK); + } else { + echo $tablesObj->getHtmlErrors(); + } + } else { + xoops_confirm(array('ok' => 1, 'field_tid' => $fieldTid, 'op' => 'delete'), $_SERVER['REQUEST_URI'], sprintf(_AM_TDMCREATE_FORMSUREDEL, $tablesObj->getVar('table_name'))); + } + break; + + case 'display': $fieldId = tdmcreate_CleanVars($_POST, 'field_id', 0, 'int'); if ($fieldId > 0) { $fieldsObj = $tdmcreate->getHandler('fields')->get($fieldId); - if (isset($_POST['field_parent'])) { - $field_parent = $fieldsObj->getVar('field_parent'); - $fieldsObj->setVar('field_parent', !$field_parent); - } - if (isset($_POST['field_inlist'])) { - $field_inlist = $fieldsObj->getVar('field_inlist'); - $fieldsObj->setVar('field_inlist', !$field_inlist); - } - if (isset($_POST['field_inform'])) { - $field_inform = $fieldsObj->getVar('field_inform'); - $fieldsObj->setVar('field_inform', !$field_inform); - } - if (isset($_POST['field_admin'])) { - $field_admin = $fieldsObj->getVar('field_admin'); - $fieldsObj->setVar('field_admin', !$field_admin); - } - if (isset($_POST['field_user'])) { - $field_user = $fieldsObj->getVar('field_user'); - $fieldsObj->setVar('field_user', !$field_user); - } - if (isset($_POST['field_block'])) { - $field_block = $fieldsObj->getVar('field_block'); - $fieldsObj->setVar('field_block', !$field_block); - } - if (isset($_POST['field_main'])) { - $field_main = $fieldsObj->getVar('field_main'); - $fieldsObj->setVar('field_main', !$field_main); - } - if (isset($_POST['field_search'])) { - $field_search = $fieldsObj->getVar('field_search'); - $fieldsObj->setVar('field_search', !$field_search); - } - if (isset($_POST['field_required'])) { - $field_required = $fieldsObj->getVar('field_required'); - $fieldsObj->setVar('field_required', !$field_required); - } + if (isset($_POST['field_parent'])) { + $field_parent = $fieldsObj->getVar('field_parent'); + $fieldsObj->setVar('field_parent', !$field_parent); + } + if (isset($_POST['field_inlist'])) { + $field_inlist = $fieldsObj->getVar('field_inlist'); + $fieldsObj->setVar('field_inlist', !$field_inlist); + } + if (isset($_POST['field_inform'])) { + $field_inform = $fieldsObj->getVar('field_inform'); + $fieldsObj->setVar('field_inform', !$field_inform); + } + if (isset($_POST['field_admin'])) { + $field_admin = $fieldsObj->getVar('field_admin'); + $fieldsObj->setVar('field_admin', !$field_admin); + } + if (isset($_POST['field_user'])) { + $field_user = $fieldsObj->getVar('field_user'); + $fieldsObj->setVar('field_user', !$field_user); + } + if (isset($_POST['field_block'])) { + $field_block = $fieldsObj->getVar('field_block'); + $fieldsObj->setVar('field_block', !$field_block); + } + if (isset($_POST['field_main'])) { + $field_main = $fieldsObj->getVar('field_main'); + $fieldsObj->setVar('field_main', !$field_main); + } + if (isset($_POST['field_search'])) { + $field_search = $fieldsObj->getVar('field_search'); + $fieldsObj->setVar('field_search', !$field_search); + } + if (isset($_POST['field_required'])) { + $field_required = $fieldsObj->getVar('field_required'); + $fieldsObj->setVar('field_required', !$field_required); + } if ($tdmcreate->getHandler('fields')->insert($fieldsObj)) { redirect_header('fields.php', 3, _AM_TDMCREATE_TOGGLE_SUCCESS); } $GLOBALS['xoopsTpl']->assign('error', $fieldsObj->getHtmlErrors()); - } - break; + } + break; } -include __DIR__ . '/footer.php'; \ No newline at end of file +include __DIR__.'/footer.php'; Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/footer.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/footer.php 2015-07-01 10:38:11 UTC (rev 13094) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/footer.php 2015-07-03 12:44:44 UTC (rev 13095) @@ -1,4 +1,5 @@ <?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 @@ -9,13 +10,15 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ /** - * tdmcreate module + * 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')); Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/header.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/header.php 2015-07-01 10:38:11 UTC (rev 13094) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/header.php 2015-07-03 12:44:44 UTC (rev 13095) @@ -1,4 +1,5 @@ <?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 @@ -9,32 +10,34 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ /** - * tdmcreate module + * 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(__DIR__))) . '/include/cp_header.php'; -include_once dirname(__DIR__) . '/include/common.php'; +include_once dirname(dirname(dirname(__DIR__))).'/include/cp_header.php'; +include_once dirname(__DIR__).'/include/common.php'; // $thisDirname = $GLOBALS['xoopsModule']->getVar('dirname'); // Link System Icons $sysPathIcon16 = $GLOBALS['xoopsModule']->getInfo('sysicons16'); $sysPathIcon32 = $GLOBALS['xoopsModule']->getInfo('sysicons32'); // Link Local Icons -$modPathIcon16 = $GLOBALS['xoopsModule']->getInfo('modicons16'); -$modPathIcon32 = $GLOBALS['xoopsModule']->getInfo('modicons32'); +$modPathIcon16 = $GLOBALS['xoopsModule']->getInfo('modicons16'); +$modPathIcon32 = $GLOBALS['xoopsModule']->getInfo('modicons32'); $pathModuleAdmin = $GLOBALS['xoopsModule']->getInfo('dirmoduleadmin'); // TDMCreate Instance $tdmcreate = TDMCreateHelper::getInstance(); // MyTextSanitizer -$myts =& MyTextSanitizer::getInstance(); +$myts = &MyTextSanitizer::getInstance(); if (!isset($xoopsTpl) || !is_object($xoopsTpl)) { - include_once(XOOPS_ROOT_PATH . "/class/template.php"); + include_once XOOPS_ROOT_PATH.'/class/template.php'; $xoopsTpl = new XoopsTpl(); } // System Icons @@ -48,10 +51,10 @@ xoops_loadLanguage('modinfo', $thisDirname); xoops_loadLanguage('main', $thisDirname); // Locad admin menu class -if (file_exists($GLOBALS['xoops']->path($pathModuleAdmin . '/moduleadmin.php'))) { - include_once $GLOBALS['xoops']->path($pathModuleAdmin . '/moduleadmin.php'); +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); + redirect_header('../../../admin.php', 5, _AM_MODULEADMIN_MISSING, false); } xoops_cp_header(); $adminMenu = new ModuleAdmin(); Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/index.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/index.php 2015-07-01 10:38:11 UTC (rev 13094) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/index.php 2015-07-03 12:44:44 UTC (rev 13095) @@ -1,4 +1,5 @@ <?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 @@ -9,42 +10,46 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ /** - * tdmcreate module + * 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 __DIR__ . '/header.php'; +include __DIR__.'/header.php'; +$countSettings = $tdmcreate->getHandler('settings')->getCount(); $countModules = $tdmcreate->getHandler('modules')->getCount(); -$countTables = $tdmcreate->getHandler('tables')->getCount(); -$countFields = $tdmcreate->getHandler('fields')->getCount(); -$countFiles = $tdmcreate->getHandler('morefiles')->getCount(); +$countTables = $tdmcreate->getHandler('tables')->getCount(); +$countFields = $tdmcreate->getHandler('fields')->getCount(); +$countFiles = $tdmcreate->getHandler('morefiles')->getCount(); unset($criteria); $templateMain = 'tdmcreate_index.tpl'; $adminMenu->addInfoBox(_AM_TDMCREATE_ADMIN_NUMMODULES); -$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, '<label>' . _AM_TDMCREATE_THEREARE_NUMMODULES . '</label>', $countModules, 'Green'); -$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, '<label>' . _AM_TDMCREATE_THEREARE_NUMTABLES . '</label>', $countTables, 'Orange'); -$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, '<label>' . _AM_TDMCREATE_THEREARE_NUMFIELDS . '</label>', $countFields, 'Gray'); -$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, '<label>' . _AM_TDMCREATE_THEREARE_NUMFILES . '</label>', $countFiles, 'Red'); +$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, '<label>'._AM_TDMCREATE_THEREARE_NUMSETTINGS.'</label>', $countSettings, 'Blue'); +$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, '<label>'._AM_TDMCREATE_THEREARE_NUMMODULES.'</label>', $countModules, 'Green'); +$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, '<label>'._AM_TDMCREATE_THEREARE_NUMTABLES.'</label>', $countTables, 'Orange'); +$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, '<label>'._AM_TDMCREATE_THEREARE_NUMFIELDS.'</label>', $countFields, 'Gray'); +$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, '<label>'._AM_TDMCREATE_THEREARE_NUMFILES.'</label>', $countFiles, 'Red'); // Upload Folders $folder = array( - TDMC_UPLOAD_PATH, - TDMC_UPLOAD_REPOSITORY_PATH, - TDMC_UPLOAD_IMGMOD_PATH, - TDMC_UPLOAD_IMGTAB_PATH + TDMC_UPLOAD_PATH, + TDMC_UPLOAD_REPOSITORY_PATH, + TDMC_UPLOAD_IMGMOD_PATH, + TDMC_UPLOAD_IMGTAB_PATH, ); // Uploads Folders Created -foreach (array_keys( $folder) as $i) { +foreach (array_keys($folder) as $i) { $adminMenu->addConfigBoxLine($folder[$i], 'folder'); $adminMenu->addConfigBoxLine(array($folder[$i], '777'), 'chmod'); } $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('index.php')); $GLOBALS['xoopsTpl']->assign('index', $adminMenu->renderIndex()); -include __DIR__ . '/footer.php'; +include __DIR__.'/footer.php'; Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/menu.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/menu.php 2015-07-01 10:38:11 UTC (rev 13094) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/menu.php 2015-07-03 12:44:44 UTC (rev 13095) @@ -1,4 +1,5 @@ <?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 @@ -9,50 +10,53 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ /** - * tdmcreate module + * 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; +$module_handler = &xoops_gethandler('module'); +$xoopsModule = &XoopsModule::getByDirname('TDMCreate'); +$moduleInfo = &$module_handler->get($xoopsModule->getVar('mid')); +$sysPathIcon32 = $moduleInfo->getInfo('sysicons32'); +$modPathIcon32 = $moduleInfo->getInfo('modicons32'); +$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]['link'] = 'admin/index.php'; +$adminmenu[$i]['icon'] = $sysPathIcon32.'/dashboard.png'; +++$i; $adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU2; -$adminmenu[$i]['link'] = 'admin/settings.php'; -$adminmenu[$i]['icon'] = 'assets/icons/32/settings.png'; -$i++; +$adminmenu[$i]['link'] = 'admin/settings.php'; +$adminmenu[$i]['icon'] = $modPathIcon32.'/settings.png'; +++$i; $adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU3; -$adminmenu[$i]['link'] = 'admin/modules.php'; -$adminmenu[$i]['icon'] = 'assets/icons/32/addmodule.png'; -$i++; +$adminmenu[$i]['link'] = 'admin/modules.php'; +$adminmenu[$i]['icon'] = $modPathIcon32.'/addmodule.png'; +++$i; $adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU4; -$adminmenu[$i]['link'] = 'admin/tables.php'; -$adminmenu[$i]['icon'] = 'assets/icons/32/addtable.png'; -$i++; +$adminmenu[$i]['link'] = 'admin/tables.php'; +$adminmenu[$i]['icon'] = $modPathIcon32.'/addtable.png'; +++$i; $adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU5; -$adminmenu[$i]['link'] = 'admin/fields.php'; -$adminmenu[$i]['icon'] = 'assets/icons/32/fields.png'; -$i++; +$adminmenu[$i]['link'] = 'admin/fields.php'; +$adminmenu[$i]['icon'] = $modPathIcon32.'/fields.png'; +++$i; $adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU6; -$adminmenu[$i]['link'] = 'admin/morefiles.php'; -$adminmenu[$i]['icon'] = 'assets/icons/32/files.png'; -$i++; +$adminmenu[$i]['link'] = 'admin/morefiles.php'; +$adminmenu[$i]['icon'] = $modPathIcon32.'/files.png'; +++$i; $adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU7; -$adminmenu[$i]['link'] = 'admin/building.php'; -$adminmenu[$i]['icon'] = 'assets/icons/32/builder.png'; -$i++; +$adminmenu[$i]['link'] = 'admin/building.php'; +$adminmenu[$i]['icon'] = $modPathIcon32.'/builder.png'; +++$i; $adminmenu[$i]['title'] = _MI_TDMCREATE_ABOUT; -$adminmenu[$i]['link'] = 'admin/about.php'; -$adminmenu[$i]['icon'] = $sysPathIcon32 . '/about.png'; +$adminmenu[$i]['link'] = 'admin/about.php'; +$adminmenu[$i]['icon'] = $sysPathIcon32.'/about.png'; unset($i); Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/modules.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/modules.php 2015-07-01 10:38:11 UTC (rev 13094) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/modules.php 2015-07-03 12:44:44 UTC (rev 13095) @@ -1,4 +1,5 @@ <?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 @@ -9,16 +10,18 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ /** - * tdmcreate module + * 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 __DIR__ . '/header.php'; +include __DIR__.'/header.php'; // Recovered value of argument op in the URL $ $op = XoopsRequest::getString('op', 'list'); // @@ -36,12 +39,10 @@ $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); + $GLOBALS['xoopsTpl']->assign('modPathIcon16', TDMC_URL.'/'.$modPathIcon16); $modulesCount = $tdmcreate->getHandler('modules')->getCountModules(); - $modulesAll = $tdmcreate->getHandler('modules')->getAllModules($start, $limit); + $modulesAll = $tdmcreate->getHandler('modules')->getAllModules($start, $limit); // Redirect if there aren't modules if (0 == $modulesCount) { redirect_header('modules.php?op=new', 2, _AM_TDMCREATE_NOTMODULES); @@ -54,8 +55,8 @@ unset($module); } if ($modulesCount > $limit) { - include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; - $pagenav = new XoopsPageNav($modulesCount, $limit, $start, 'start', 'op=list&limit=' . $limit); + include_once XOOPS_ROOT_PATH.'/class/pagenav.php'; + $pagenav = new XoopsPageNav($modulesCount, $limit, $start, 'start', 'op=list&limit='.$limit); $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4)); } } else { @@ -71,8 +72,8 @@ $adminMenu->addItemButton(_AM_TDMCREATE_MODULES_LIST, 'modules.php', 'list'); $GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton()); - $modulesObj =& $tdmcreate->getHandler('modules')->create(); - $form = $modulesObj->getForm(); + $modulesObj = &$tdmcreate->getHandler('modules')->create(); + $form = $modulesObj->getForm(); $GLOBALS['xoopsTpl']->assign('form', $form->render()); break; @@ -81,37 +82,37 @@ redirect_header('modules.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors())); } if (isset($modId)) { - $modulesObj =& $tdmcreate->getHandler('modules')->get($modId); + $modulesObj = &$tdmcreate->getHandler('modules')->get($modId); } else { - $modulesObj =& $tdmcreate->getHandler('modules')->create(); + $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_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_... [truncated message content] |