From: <txm...@us...> - 2015-05-03 20:24:27
|
Revision: 13055 http://sourceforge.net/p/xoops/svn/13055 Author: txmodxoops Date: 2015-05-03 20:24:25 +0000 (Sun, 03 May 2015) Log Message: ----------- Updated In list you see name of category or topic Modified Paths: -------------- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateArchitecture.php XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminHeader.php XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminIndex.php XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminObjects.php XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminPages.php XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminPermissions.php XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/classes/ClassFiles.php XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/templates/admin/TemplatesAdminPages.php Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateArchitecture.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateArchitecture.php 2015-05-03 12:51:24 UTC (rev 13054) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateArchitecture.php 2015-05-03 20:24:25 UTC (rev 13055) @@ -321,7 +321,7 @@ if (1 == $module->getVar('mod_admin')) { // Admin Header File $adminHeader = AdminHeader::getInstance(); - $adminHeader->write($module, $table, 'header.php'); + $adminHeader->write($module, $table, $tables, 'header.php'); $ret[] = $adminHeader->render(); // Admin Index File $adminIndex = AdminIndex::getInstance(); Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminHeader.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminHeader.php 2015-05-03 12:51:24 UTC (rev 13054) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminHeader.php 2015-05-03 20:24:25 UTC (rev 13055) @@ -66,10 +66,11 @@ * @param $table * @param $filename */ - public function write($module, $table, $filename) + public function write($module, $table, $tables, $filename) { $this->setModule($module); $this->setTable($table); + $this->setTables($tables); $this->setFileName($filename); } @@ -83,7 +84,7 @@ * @param $table * @return string */ - private function getAdminHeader($moduleDirname, $table) + private function getAdminHeader($moduleDirname, $table, $tables) { $ucfModuleDirname = ucfirst($moduleDirname); $ret = <<<EOT @@ -104,6 +105,14 @@ EOT; } + if (is_array($tables)) { + foreach (array_keys($tables) as $i) { + $tableName = $tables[$i]->getVar('table_name'); + $ret .= <<<EOT +\${$tableName}Handler =& \${$moduleDirname}->getHandler('{$tableName}');\n +EOT; + } + } $ret .= <<<EOT // \$myts =& MyTextSanitizer::getInstance(); @@ -145,10 +154,11 @@ { $module = $this->getModule(); $table = $this->getTable(); + $tables = $this->getTables(); $filename = $this->getFileName(); $moduleDirname = $module->getVar('mod_dirname'); $content = $this->getHeaderFilesComments($module, $filename); - $content .= $this->getAdminHeader($moduleDirname, $table); + $content .= $this->getAdminHeader($moduleDirname, $table, $tables); $this->tdmcfile->create($moduleDirname, 'admin', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED); Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminIndex.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminIndex.php 2015-05-03 12:51:24 UTC (rev 13054) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminIndex.php 2015-05-03 20:24:25 UTC (rev 13055) @@ -97,7 +97,7 @@ foreach (array_keys($tables) as $i) { $tableName = $tables[$i]->getVar('table_name'); $content .= <<<EOT -\${$tableName}Handler =& \${$moduleDirname}->getHandler('{$tableName}'); +//\${$tableName}Handler =& \${$moduleDirname}->getHandler('{$tableName}'); \$count_{$tableName} = \${$tableName}Handler->getCount();\n EOT; } Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminObjects.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminObjects.php 2015-05-03 12:51:24 UTC (rev 13054) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminObjects.php 2015-05-03 20:24:25 UTC (rev 13055) @@ -88,17 +88,34 @@ /* * @public function getUrlFileSetVar - * @param string $tableName - * @param string $fieldName + * @param $moduleDirname + * @param $tableName + * @param $fieldName * @return string */ - public function getUrlFileSetVar($tableName, $fieldName) + public function getUrlFileSetVar($moduleDirname, $tableName, $fieldName) { - $ret = <<<EOT + $stuModuleDirname = strtoupper($moduleDirname); + $ret = <<<EOT // Set Var {$fieldName} \${$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'), + \${$moduleDirname}->getConfig('maxsize'), null, null); + if (\$uploader->fetchMedia(\$_POST['xoops_upload_file'][])) { + \$uploader->fetchMedia(\$_POST['xoops_upload_file'][]); + if (!\$uploader->upload()) { + \$errors = \$uploader->getErrors(); + redirect_header('javascript:history.go(-1)', 3, \$errors); + } else { + \${$tableName}Obj->setVar('{$fieldName}', \$uploader->getSavedFileName()); + } + }\n EOT; - return $ret; + + return $ret; } /* @@ -195,6 +212,20 @@ } /* + * @public function getIdGetVar + * @param string $lpFieldName + * @return string + */ + public function getIdGetVar($lpFieldName) + { + $ret = <<<EOT +\t\t\t\t// Get Var Id +\t\t\t\t\${$lpFieldName}['id'] = \$i;\n +EOT; + return $ret; + } + + /* * @public function getSimpleGetVar * @param string $lpFieldName * @param string $rpFieldName @@ -230,6 +261,30 @@ EOT; return $ret; } + + /* + * @public function getParentTopicGetVar + * @param string $moduleDirname + * @param string $lpFieldName + * @param string $rpFieldName + * @param string $tableName + * @param string $tableSoleNameTopic + * @param string $tableNameTopic + * @param string $fieldNameParent + * @return string + */ + public function getParentTopicGetVar($moduleDirname, $lpFieldName, $rpFieldName, $tableName, $tableSoleNameTopic, $tableNameTopic, $fieldNameParent) + { + $ret = <<<EOT +\t\t\t\tif(!isset(\${$tableNameTopic}Handler)) { +\t\t\t\t\t// Get {$tableNameTopic} Handler +\t\t\t\t\t\${$tableNameTopic}Handler =& \${$moduleDirname}->getHandler('{$tableNameTopic}'); +\t\t\t\t} +\t\t\t\t// Get Var {$fieldNameParent} +\t\t\t\t\${$lpFieldName}['{$rpFieldName}'] = \${$tableNameTopic}Handler->get{$tableSoleNameTopic}FromId(\${$tableName}All[\$i]->getVar('{$fieldNameParent}'));\n +EOT; + return $ret; + } /* * @public function getUploadImageGetVar Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminPages.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminPages.php 2015-05-03 12:51:24 UTC (rev 13054) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminPages.php 2015-05-03 20:24:25 UTC (rev 13055) @@ -90,8 +90,6 @@ \$op = XoopsRequest::getString('op', 'list'); // Request {$fpif} \${$fpif} = XoopsRequest::getInt('{$fpif}'); -// Get {$ucfTableName} Handler -\${$tableName}Handler =& \${$moduleDirname}->getHandler('{$tableName}'); // Switch options switch (\$op) {\n @@ -155,14 +153,17 @@ EOT; foreach (array_keys($fields) as $f) { $fieldName = $fields[$f]->getVar('field_name'); - $fieldParent = $fields[$f]->getVar('field_parent'); + $fieldParent = $fields[$f]->getVar('field_parent'); // Verify if table_fieldname is not empty $lpFieldName = !empty($tableFieldname) ? substr($fieldName, 0, strpos($fieldName, '_')) : $tableSoleName; - $rpFieldName = $this->tdmcfile->getRightString($fieldName); + $rpFieldName = $this->tdmcfile->getRightString($fieldName); // + if($f < 1) { + $ret .= $this->adminobjects->getIdGetVar($lpFieldName); + } $fieldElement = $fields[$f]->getVar('field_element'); - if ((1 == $fields[$f]->getVar('field_admin')) || ((1 == $tableAutoincrement) && (1 == $fields[$f]->getVar('field_inlist')))) { - switch ($fieldElement) { + if ((1 == $fields[$f]->getVar('field_admin')) || ((1 == $tableAutoincrement) && (1 == $fields[$f]->getVar('field_inlist')))) { + switch ($fieldElement) { case 3: case 4: $ret .= $this->adminobjects->getTextAreaGetVar($lpFieldName, $rpFieldName, $tableName, $fieldName); @@ -180,26 +181,33 @@ $ret .= $this->adminobjects->getTextDateSelectGetVar($lpFieldName, $rpFieldName, $tableName, $fieldName); break; default: - if ((1 == $fieldParent) && 0 == $table->getVar('table_category')) { - if ($fieldElement > 15) { - $fieldElements = $this->tdmcreate->getHandler('fieldelements')->get($fieldElement); - $fieldElementTid = $fieldElements->getVar('fieldelement_tid'); - $fieldElementName = $fieldElements->getVar('fieldelement_name'); - $rpFieldElementName = strtolower(str_replace('Table : ', '', $fieldElementName)); + if ($fieldElement > 15) { + $fieldElements = $this->tdmcreate->getHandler('fieldelements')->get($fieldElement); + $fieldElementTid = $fieldElements->getVar('fieldelement_tid'); + $fieldElementName = $fieldElements->getVar('fieldelement_name'); + $rpFieldElementName = strtolower(str_replace('Table : ', '', $fieldElementName)); + if (1 == $fieldParent) { + $criteriaFieldsTopic = new CriteriaCompo(); + $criteriaFieldsTopic->add(new Criteria('field_tid', $fieldElementTid)); + $fieldsTopic = $this->tdmcreate->getHandler('fields')->getObjects($criteriaFieldsTopic); + unset($criteriaFieldsTopic); + foreach (array_keys($fieldsTopic) as $ft) { + if (1 == $fieldsTopic[$ft]->getVar('field_main')) { + $fieldNameTopic = $fieldsTopic[$ft]->getVar('field_name'); + } + } + $ret .= $this->adminobjects->getTopicGetVar($lpFieldName, $rpFieldName, $tableName, $rpFieldElementName, $fieldName, $fieldNameTopic); + } else { // - $fieldNameParent = $fieldName; - // - $criteriaFieldsTopic = new CriteriaCompo(); - $criteriaFieldsTopic->add(new Criteria('field_tid', $fieldElementTid)); - $fieldsTopic = $this->tdmcreate->getHandler('fields')->getObjects($criteriaFieldsTopic); - unset($criteriaFieldsTopic); - foreach (array_keys($fieldsTopic) as $ft) { - if (1 == $fieldsTopic[$ft]->getVar('field_main')) { - $fieldNameTopic = $fieldsTopic[$ft]->getVar('field_name'); - } + $criteriaTablesTopic = new CriteriaCompo(); + $criteriaTablesTopic->add(new Criteria('table_id', $fieldElementTid)); + $tablesTopic = $this->tdmcreate->getHandler('tables')->getObjects($criteriaTablesTopic); + unset($criteriaTablesTopic); + foreach (array_keys($tablesTopic) as $ft) { + $ucfTableSoleNameTopic = ucfirst($tablesTopic[$ft]->getVar('table_solename')); } - $ret .= $this->adminobjects->getTopicGetVar($lpFieldName, $rpFieldName, $tableName, $rpFieldElementName, $fieldNameParent, $fieldNameTopic); - } + $ret .= $this->adminobjects->getParentTopicGetVar($moduleDirname, $lpFieldName, $rpFieldName, $tableName, $ucfTableSoleNameTopic, $rpFieldElementName, $fieldName); + } } else { $ret .= $this->adminobjects->getSimpleGetVar($lpFieldName, $rpFieldName, $tableName, $fieldName); } @@ -290,7 +298,7 @@ $ret .= $this->adminobjects->getImageListSetVar($moduleDirname, $tableName, $fieldName); break; case 12: - $ret .= $this->adminobjects->getUrlFileSetVar($tableName, $fieldName); + $ret .= $this->adminobjects->getUrlFileSetVar($moduleDirname, $tableName, $fieldName); break; case 13: $ret .= $this->adminobjects->getUploadImageSetVar($moduleDirname, $tableName, $fieldName); Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminPermissions.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminPermissions.php 2015-05-03 12:51:24 UTC (rev 13054) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminPermissions.php 2015-05-03 20:24:25 UTC (rev 13055) @@ -92,7 +92,7 @@ { redirect_header( XOOPS_URL.'/modules/'.\$xoopsModule->dirname().'/admin/permissions.php', 1, _MP_GPERMUPDATED ); } -\${$tableName}Handler =& \${$moduleDirname}->getHandler('{$tableName}'); +//\${$tableName}Handler =& \${$moduleDirname}->getHandler('{$tableName}'); // Check admin have access to this page /*\$group = \$xoopsUser->getGroups (); \$groups = xoops_getModuleOption ( 'admin_groups', \$thisDirname ); @@ -144,7 +144,7 @@ break; case 2: \$formTitle = {$language}APPROVE; - \$permName = '{$moduleDirname}_access'; + \$permName = '{$moduleDirname}_approve'; \$permDesc = {$language}APPROVE_DESC; break; case 3: Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/classes/ClassFiles.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/classes/ClassFiles.php 2015-05-03 12:51:24 UTC (rev 13054) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/classes/ClassFiles.php 2015-05-03 20:24:25 UTC (rev 13055) @@ -231,12 +231,13 @@ */ private function getHeadInForm($module, $table) { - $moduleDirname = $module->getVar('mod_dirname'); - $tableName = $table->getVar('table_name'); - $tableSoleName = $table->getVar('table_solename'); - $ucfTableName = ucfirst($tableName); + $moduleDirname = $module->getVar('mod_dirname'); + $tableName = $table->getVar('table_name'); + $tableSoleName = $table->getVar('table_solename'); + $tablePermissions = $table->getVar('table_permissions'); + $ucfTableName = ucfirst($tableName); $stuTableSoleName = strtoupper($tableSoleName); - $language = $this->getLanguage($moduleDirname, 'AM'); + $language = $this->getLanguage($moduleDirname, 'AM'); $this->formelements->initForm($module, $table); $ret = <<<EOT /* @@ -248,8 +249,27 @@ { if (\$action === false) { \$action = \$_SERVER['REQUEST_URI']; + }\n +EOT; + if(1 == $tablePermissions) { + $ret .= <<<EOT + global \$xoopsUser, \$xoopsModule; + // Permissions for uploader + \$gperm_handler =& xoops_gethandler('groupperm'); + \$groups = is_object(\$xoopsUser) ? \$xoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS; + if (\$xoopsUser) { + if ( !\$xoopsUser->isAdmin(\$xoopsModule->mid()) ) { + \$perm_upload = (\$gperm_handler->checkRight('{$moduleDirname}_ac', 32, \$groups, \$xoopsModule->getVar('mid'))) ? true : false ; + }else{ + \$perm_upload = true; + } + }else{ + \$perm_upload = (\$gperm_handler->checkRight('{$moduleDirname}_ac', 32, \$groups, \$xoopsModule->getVar('mid'))) ? true : false ; } - // Title +EOT; + } + $ret .= <<<EOT + // Title \$title = \$this->isNew() ? sprintf({$language}{$stuTableSoleName}_ADD) : sprintf({$language}{$stuTableSoleName}_EDIT); // Get Theme Form xoops_load('XoopsFormLoader'); @@ -380,11 +400,15 @@ * @param $fpmf * @return string */ - private function getClassHandler($moduleDirname, $tableName, $tableCategory, $tableFieldname, $fpif, $fpmf) + private function getClassHandler($moduleDirname, $table, $fpif, $fpmf) { - $ucfModuleDirname = ucfirst($moduleDirname); + $tableName = $table->getVar('table_name'); + $tableCategory = $table->getVar('table_category'); + $tableSoleName = $table->getVar('table_solename'); + $tableFieldname = $table->getVar('table_fieldname'); + $ucfModuleDirname = ucfirst($moduleDirname); $ucfTableName = ucfirst($tableName); - $ucfTableFieldname = ucfirst($tableFieldname); + $ucfTableSoleName = ucfirst($tableSoleName); $ucfModuleTable = $ucfModuleDirname . $ucfTableName; $ret = <<<EOT /* @@ -393,6 +417,10 @@ class {$ucfModuleTable}Handler extends XoopsPersistableObjectHandler { /* + * @var mixed + */ + private \${$moduleDirname} = null; + /* * Constructor * * @param string \$db @@ -400,6 +428,7 @@ public function __construct(&\$db) { parent::__construct(\$db, '{$moduleDirname}_{$tableName}', '{$moduleDirname}{$tableName}', '{$fpif}', '{$fpmf}'); + \$this->{$moduleDirname} = {$ucfModuleDirname}Helper::getInstance(); } /** @@ -464,22 +493,22 @@ if (1 == $tableCategory) { $ret .= <<<EOT \n\t/** - * Returns the {$ucfTableFieldname} from id + * Returns the {$ucfTableSoleName} from id * * @return string **/ - public function get{$ucfTableFieldname}FromId(\${$tableFieldname}Id) + public function get{$ucfTableSoleName}FromId(\${$tableSoleName}Id) { - \${$tableFieldname}Id = (int) ( \${$tableFieldname}Id ); - \${$fpmf} = ''; - if (\${$tableFieldname}id > 0) { - \${$tableFieldname}Handler = \$this->{$moduleDirname}->getHandler( '{$tableName}' ); - \${$tableFieldname} = & \${$tableFieldname}Handler->get( \${$tableFieldname}Id ); - if (is_object( \${$tableFieldname} )) { - \${$fpmf} = \${$tableFieldname}->getVar( '{$fpmf}' ); + \${$tableSoleName}Id = (int) ( \${$tableSoleName}Id ); + \${$tableSoleName} = ''; + if (\${$tableSoleName}Id > 0) { + \${$tableName}Handler = \$this->{$moduleDirname}->getHandler( '{$tableName}' ); + \${$tableSoleName}Obj = & \${$tableName}Handler->get( \${$tableSoleName}Id ); + if (is_object( \${$tableSoleName}Obj )) { + \${$tableSoleName} = \${$tableSoleName}Obj->getVar( '{$fpmf}' ); } } - return \${$fpmf}; + return \${$tableSoleName}; }\n EOT; } @@ -503,9 +532,6 @@ $module = $this->getModule(); $table = $this->getTable(); $tableName = $table->getVar('table_name'); - $tableCategory = $table->getVar('table_category'); - $tFieldname = $table->getVar('table_fieldname'); - $tableFieldname = empty($tFieldname) ? $tableName : $tFieldname; $moduleDirname = $module->getVar('mod_dirname'); $fields = $this->getTableFields($table->getVar('table_id')); foreach (array_keys($fields) as $f) { @@ -528,7 +554,7 @@ $content .= $this->getFootInForm(); } $content .= $this->getToArray(); - $content .= $this->getClassHandler($moduleDirname, $tableName, $tableCategory, $tableFieldname, $fpif, $fpmf); + $content .= $this->getClassHandler($moduleDirname, $table, $fpif, $fpmf); $this->tdmcfile->create($moduleDirname, 'class', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED); Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/templates/admin/TemplatesAdminPages.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/templates/admin/TemplatesAdminPages.php 2015-05-03 12:51:24 UTC (rev 13054) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/templates/admin/TemplatesAdminPages.php 2015-05-03 20:24:25 UTC (rev 13055) @@ -155,10 +155,10 @@ } $ret .= <<<EOT <td class="center"> - <a href="{$tableName}.php?op=edit&{$field_id}=<{\$list.{$rpFieldName}}>" title="<{\$smarty.const._EDIT}>"> + <a href="{$tableName}.php?op=edit&{$field_id}=<{\$list.id}>" title="<{\$smarty.const._EDIT}>"> <img src="<{xoModuleIcons16 edit.png}>" alt="<{\$smarty.const._EDIT}>" /> </a> - <a href="{$tableName}.php?op=delete&{$field_id}=<{\$list.{$rpFieldName}}>" title="<{\$smarty.const._DELETE}>"> + <a href="{$tableName}.php?op=delete&{$field_id}=<{\$list.id}>" title="<{\$smarty.const._DELETE}>"> <img src="<{xoModuleIcons16 delete.png}>" alt="<{\$smarty.const._DELETE}>" /> </a> </td> |
From: <txm...@us...> - 2015-05-25 21:36:03
|
Revision: 13068 http://sourceforge.net/p/xoops/svn/13068 Author: txmodxoops Date: 2015-05-25 21:36:01 +0000 (Mon, 25 May 2015) Log Message: ----------- - Fix url logo - Fix language groups - Fix array file notifications Modified Paths: -------------- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateArchitecture.php XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/language/LanguageModinfo.php XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/user/UserXoopsVersion.php Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateArchitecture.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateArchitecture.php 2015-05-25 20:22:35 UTC (rev 13067) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateArchitecture.php 2015-05-25 21:36:01 UTC (rev 13068) @@ -116,17 +116,17 @@ $this->structure->makeDirAndCopyFile('class', $indexFile, 'index.html'); // Creation of "assets" folder and index.html file $this->structure->makeDirAndCopyFile('assets', $indexFile, 'index.html'); - // Creation of "css" folder and index.html file + // Creation of "assets/css" folder and index.html file $this->structure->makeDirAndCopyFile('assets/css', $indexFile, 'index.html'); - // Creation of "icons" folder and index.html file + // Creation of "assets/icons" folder and index.html file $this->structure->makeDirAndCopyFile('assets/icons', $indexFile, 'index.html'); - // Creation of "images/icons/16" folder and index.html file + // Creation of "assets/icons/16" folder and index.html file $this->structure->makeDirAndCopyFile('assets/icons/16', $indexFile, 'index.html'); - // Creation of "images/icons/32" folder and index.html file + // Creation of "assets/icons/32" folder and index.html file $this->structure->makeDirAndCopyFile('assets/icons/32', $indexFile, 'index.html'); - // Creation of "images" folder and index.html file + // Creation of "assets/images" folder and index.html file $this->structure->makeDirAndCopyFile('assets/images', $indexFile, 'index.html'); - // Creation of "images" folder and index.html file + // Creation of "assets/js" folder and index.html file $this->structure->makeDirAndCopyFile('assets/js', $indexFile, 'index.html'); //Copy the logo of the module $modImage = str_replace(' ', '', strtolower($module->getVar('mod_image'))); @@ -136,12 +136,12 @@ // If file exists if (!file_exists($logoGifFrom)) { // Rename file - $copyFile = TDMC_IMAGE_LOGOS_PATH . '/xoopsdevelopmentteam_logo.gif'; + $copyFile = TDMC_IMAGE_LOGOS_URL . '/xoopsdevelopmentteam_logo.gif'; $copyNewFile = $logoGifFrom; copy($copyFile, $copyNewFile); } else { // Copy file - $copyFile = TDMC_IMAGE_LOGOS_PATH . '/' . $stlModuleAuthor . '_logo.gif'; + $copyFile = TDMC_IMAGE_LOGOS_URL . '/' . $stlModuleAuthor . '_logo.gif'; $copyNewFile = $logoGifFrom; copy($copyFile, $copyNewFile); } Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/language/LanguageModinfo.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/language/LanguageModinfo.php 2015-05-25 20:22:35 UTC (rev 13067) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/language/LanguageModinfo.php 2015-05-25 21:36:01 UTC (rev 13068) @@ -138,8 +138,8 @@ private function getLanguageAdmin($language) { $ret = $this->defines->getAboveHeadDefines('Admin Nav'); - $ret .= $this->defines->getDefine($language, "ADMINPAGER", "Admin pager"); - $ret .= $this->defines->getDefine($language, "ADMINPAGER_DESC", "Admin per page list"); + $ret .= $this->defines->getDefine($language, "ADMIN_PAGER", "Admin pager"); + $ret .= $this->defines->getDefine($language, "ADMIN_PAGER_DESC", "Admin per page list"); return $ret; } @@ -206,8 +206,8 @@ private function getLanguageUser($language) { $ret = $this->defines->getAboveDefines('User'); - $ret .= $this->defines->getDefine($language, "USERPAGER", "User pager"); - $ret .= $this->defines->getDefine($language, "USERPAGER_DESC", "User per page list"); + $ret .= $this->defines->getDefine($language, "USER_PAGER", "User pager"); + $ret .= $this->defines->getDefine($language, "USER_PAGER_DESC", "User per page list"); return $ret; } @@ -232,6 +232,12 @@ $ret .= $this->defines->getDefine($language, "KEYWORDS", "Keywords"); $ret .= $this->defines->getDefine($language, "KEYWORDS_DESC", "Insert here the keywords (separate by comma)"); if (is_object($table)) { + /*if ($table->getVar('table_permissions') != 0) { + $ret .= $this->defines->getDefine($language, "GROUPS", "Groups"); + $ret .= $this->defines->getDefine($language, "GROUPS_DESC", "Groups to have permissions"); + $ret .= $this->defines->getDefine($language, "ADMIN_GROUPS", "Admin Groups"); + $ret .= $this->defines->getDefine($language, "ADMIN_GROUPS_DESC", "Admin Groups to have permissions access"); + }*/ if ($table->getVar('table_image') != '') { $ret .= $this->defines->getDefine($language, "MAXSIZE", "Max size"); $ret .= $this->defines->getDefine($language, "MAXSIZE_DESC", "Set a number of max size uploads file in byte"); @@ -310,20 +316,20 @@ } /* - * @private function getLanguagePermissions + * @private function getLanguagePermissionsGroups * @param string $language */ /** * @param $language * @return string */ - private function getLanguagePermissions($language) + private function getLanguagePermissionsGroups($language) { $ret = $this->defines->getAboveDefines('Permissions Groups'); $ret .= $this->defines->getDefine($language, "GROUPS", "Groups access"); $ret .= $this->defines->getDefine($language, "GROUPS_DESC", "Select general access permission for groups."); - $ret .= $this->defines->getDefine($language, "ADMINGROUPS", "Admin Group Permissions"); - $ret .= $this->defines->getDefine($language, "ADMINGROUPS_DESC", "Which groups have access to tools and permissions page"); + $ret .= $this->defines->getDefine($language, "ADMIN_GROUPS", "Admin Group Permissions"); + $ret .= $this->defines->getDefine($language, "ADMIN_GROUPS_DESC", "Which groups have access to tools and permissions page"); return $ret; } @@ -378,7 +384,7 @@ $content .= $this->getLanguageNotifications($language); } if (1 == $table->getVar('table_permissions')) { - $content .= $this->getLanguagePermissions($language); + $content .= $this->getLanguagePermissionsGroups($language); } } $content .= $this->getLanguageFooter(); Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/user/UserXoopsVersion.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/user/UserXoopsVersion.php 2015-05-25 20:22:35 UTC (rev 13067) +++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/user/UserXoopsVersion.php 2015-05-25 21:36:01 UTC (rev 13068) @@ -496,7 +496,7 @@ } } } - if (1 == $module->getVar('mod_permissions') && 1 == $table->getVar('table_permissions')) { + if (1 == $table->getVar('table_permissions')) { $ret .= <<<EOT // Get groups \$memberHandler =& xoops_gethandler('member'); @@ -523,8 +523,8 @@ } \$modversion['config'][] = array( 'name' => "admin_groups", - 'title' => "{$language}ADMINGROUPS", - 'description' => "{$language}ADMINGROUPS_DESC", + 'title' => "{$language}ADMIN_GROUPS", + 'description' => "{$language}ADMIN_GROUPS_DESC", 'formtype' => "select_multi", 'valuetype' => "array", 'options' => \$admin_groups, @@ -576,8 +576,8 @@ $ret .= <<<EOT \$modversion['config'][] = array( 'name' => "adminpager", - 'title' => "{$language}ADMINPAGER", - 'description' => "{$language}ADMINPAGER_DESC", + 'title' => "{$language}ADMIN_PAGER", + 'description' => "{$language}ADMIN_PAGER_DESC", 'formtype' => "textbox", 'valuetype' => "int", 'default' => 10);\n\n @@ -587,8 +587,8 @@ $ret .= <<<EOT \$modversion['config'][] = array( 'name' => "userpager", - 'title' => "{$language}USERPAGER", - 'description' => "{$language}USERPAGER_DESC", + 'title' => "{$language}USER_PAGER", + 'description' => "{$language}USER_PAGER_DESC", 'formtype' => "textbox", 'valuetype' => "int", 'default' => 10);\n\n @@ -644,12 +644,12 @@ * @param $typeOfNotify */ /** - * @param $language + * @param $language * @param $type - * @param $tableName - * @param $notifyFile - * @param $item - * @param $typeOfNotify + * @param $tableName + * @param $notifyFile + * @param $item + * @param $typeOfNotify * @return string */ private function getTypeNotifications($language, $type = 'category', $tableName, $notifyFile, $item, $typeOfNotify) @@ -699,7 +699,7 @@ */ private function getXoopsVersionNotifications($moduleDirname, $tables, $language, $filename) { - $notifyFiles = array(); + $notifyFiles = ''; $single = 'single'; foreach (array_keys($tables) as $t) { $tableId = $tables[$t]->getVar('table_id'); @@ -713,7 +713,7 @@ if ($t <= count($tableName)) { /*$notifyFiles[] = "'" . $tableName . ".php', "; } else {*/ - $notifyFiles[] = "'" . $tableName . ".php'"; + $notifyFiles = "'" . $tableName . ".php'"; } } if (1 == $tables[$t]->getVar('table_single')) { @@ -779,6 +779,7 @@ private function getXoopsVersionNotificationCodeShort($language, $type, $name, $title, $from) { $title = strtoupper($title); + $from = explode(', ', $from); $from = implode(', ', $from); $ret = <<<EOT \$modversion['notification']['{$type}'][] = array( |