|
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
|