Skip to content

Commit 47db2a4

Browse files
committed
fixed bug in function getValuesInObject (wrong object name)
creation of form: replaced XoopsFormButton by XoopsFormButtonTray creation of modinfo.php: Config items have been created only by fields of last table; changed to all tables updated changelog
1 parent 5e4bad2 commit 47db2a4

4 files changed

Lines changed: 77 additions & 40 deletions

File tree

class/files/classes/ClassFiles.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ private function getFunctionForm($module, $table, $fieldId, $fieldInForm)
309309
//$hiddenSave = $cc->getClassXoopsFormHidden('', "'op'", "'save'", true, false);
310310
$getForm .= $cc->getClassAddElement('form', "new XoopsFormHidden('op', 'save')");
311311
//$buttonSend = $cc->getClassXoopsFormButton('', '', 'submit', '_SUBMIT', 'submit', true);
312-
$getForm .= $cc->getClassAddElement('form', "new XoopsFormButton('', 'submit', _SUBMIT, 'submit')");
312+
$getForm .= $cc->getClassAddElement('form', "new XoopsFormButtonTray('', _SUBMIT, 'submit', '', false)");
313313
$getForm .= $this->getSimpleString('return $form;', "\t\t");
314314

315315
$ret .= $pc->getPhpCodeFunction('getForm'.$ucfTableName, '$action = false', $getForm, 'public ', false, "\t");
@@ -423,7 +423,7 @@ private function getValuesInObject($moduleDirname, $table, $fields)
423423
$getValues .= $xc->getXcEqualsOperator("\${$topicTableName}", $getHandlerVar, null, false, "\t\t");
424424
$getTopicTable = "\${$topicTableName}->get(\$this->getVar('{$fieldName}'))";
425425
$getValues .= $xc->getXcEqualsOperator("\${$topicTableName}Obj", $getTopicTable, null, false, "\t\t");
426-
$fMainTopic = "\${$fieldName}->getVar('{$fieldMainTopic}')";
426+
$fMainTopic = "\${$topicTableName}Obj->getVar('{$fieldMainTopic}')";
427427
$getValues .= $xc->getXcEqualsOperator("\$ret['{$rpFieldName}']", $fMainTopic, null, false, "\t\t");
428428
} else {
429429
$getValues .= $xc->getXcGetVar("ret['{$rpFieldName}']", 'this', $fieldName, false, "\t\t");

class/files/language/LanguageModinfo.php

Lines changed: 39 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -225,50 +225,52 @@ private function getLanguageUser($language)
225225
/**
226226
* @private function getLanguageConfig
227227
* @param $language
228-
* @param $table
228+
* @param $tables
229229
*
230230
* @return string
231231
*/
232-
private function getLanguageConfig($language, $table)
232+
private function getLanguageConfig($language, $tables)
233233
{
234234
$df = LanguageDefines::getInstance();
235235
$ret = $df->getAboveDefines('Config');
236-
if (is_object($table) && '' != $table->getVar('table_image')) {
237-
$fields = $this->getTableFields($table->getVar('table_mid'), $table->getVar('table_id'));
238-
$fieldElement = [];
239-
foreach (array_keys($fields) as $f) {
240-
$fieldElement[] = $fields[$f]->getVar('field_element');
241-
if (in_array(4, $fieldElement)) {
242-
$fieldName = $fields[$f]->getVar('field_name');
243-
$rpFieldName = $this->getRightString($fieldName);
244-
$ucfFieldName = ucfirst($rpFieldName);
245-
$stuFieldName = strtoupper($rpFieldName);
246-
$ret .= $df->getDefine($language, 'EDITOR_'.$stuFieldName, 'Editor');
247-
$ret .= $df->getDefine($language, 'EDITOR_'.$stuFieldName.'_DESC', 'Select the Editor '.$ucfFieldName.' to use');
248-
}
249-
}
250-
unset($fieldElement);
251-
}
236+
$fieldImage = false;
237+
$useTag = false;
238+
// $usePermissions = false;
239+
foreach (array_keys($tables) as $i) {
240+
$fields = $this->getTableFields($tables[$i]->getVar('table_mid'), $tables[$i]->getVar('table_id'));
241+
foreach (array_keys($fields) as $f) {
242+
$fieldElement = $fields[$f]->getVar('field_element');
243+
if (4 == $fieldElement) {
244+
$fieldName = $fields[$f]->getVar('field_name');
245+
$rpFieldName = $this->getRightString($fieldName);
246+
$ucfFieldName = ucfirst($rpFieldName);
247+
$stuFieldName = strtoupper($rpFieldName);
248+
$ret .= $df->getDefine($language, 'EDITOR_'.$stuFieldName, 'Editor');
249+
$ret .= $df->getDefine($language, 'EDITOR_'.$stuFieldName.'_DESC', 'Select the Editor '.$ucfFieldName.' to use');
250+
}
251+
if (13 == $fieldElement) {$fieldImage = true;}
252+
}
253+
if (0 != $tables[$i]->getVar('table_tag')) {$useTag = true;}
254+
// if (0 != $tables[$i]->getVar('table_permissions')) {$usePermissions = true;}
255+
}
252256
$ret .= $df->getDefine($language, 'KEYWORDS', 'Keywords');
253257
$ret .= $df->getDefine($language, 'KEYWORDS_DESC', 'Insert here the keywords (separate by comma)');
254-
if (is_object($table)) {
255-
/*if ($table->getVar('table_permissions') != 0) {
256-
$ret .= $df->getDefine($language, "GROUPS", "Groups");
257-
$ret .= $df->getDefine($language, "GROUPS_DESC", "Groups to have permissions");
258-
$ret .= $df->getDefine($language, "ADMIN_GROUPS", "Admin Groups");
259-
$ret .= $df->getDefine($language, "ADMIN_GROUPS_DESC", "Admin Groups to have permissions access");
260-
}*/
261-
if ('' != $table->getVar('table_image')) {
262-
$ret .= $df->getDefine($language, 'MAXSIZE', 'Max size');
263-
$ret .= $df->getDefine($language, 'MAXSIZE_DESC', 'Set a number of max size uploads files in byte');
264-
$ret .= $df->getDefine($language, 'MIMETYPES', 'Mime Types');
265-
$ret .= $df->getDefine($language, 'MIMETYPES_DESC', 'Set the mime types selected');
266-
}
267-
if (0 != $table->getVar('table_tag')) {
268-
$ret .= $df->getDefine($language, 'USE_TAG', 'Use TAG');
269-
$ret .= $df->getDefine($language, 'USE_TAG_DESC', 'If you use tag module, check this option to yes');
270-
}
271-
}
258+
/*if (usePermissions) {
259+
$ret .= $df->getDefine($language, "GROUPS", "Groups");
260+
$ret .= $df->getDefine($language, "GROUPS_DESC", "Groups to have permissions");
261+
$ret .= $df->getDefine($language, "ADMIN_GROUPS", "Admin Groups");
262+
$ret .= $df->getDefine($language, "ADMIN_GROUPS_DESC", "Admin Groups to have permissions access");
263+
}*/
264+
if ($fieldImage) {
265+
$ret .= $df->getDefine($language, 'MAXSIZE', 'Max size');
266+
$ret .= $df->getDefine($language, 'MAXSIZE_DESC', 'Set a number of max size uploads files in byte');
267+
$ret .= $df->getDefine($language, 'MIMETYPES', 'Mime Types');
268+
$ret .= $df->getDefine($language, 'MIMETYPES_DESC', 'Set the mime types selected');
269+
}
270+
if ($useTag) {
271+
$ret .= $df->getDefine($language, 'USE_TAG', 'Use TAG');
272+
$ret .= $df->getDefine($language, 'USE_TAG_DESC', 'If you use tag module, check this option to yes');
273+
}
272274
$getDefinesConf = [
273275
'NUMB_COL' => 'Number Columns', 'NUMB_COL_DESC' => 'Number Columns to View.', 'DIVIDEBY' => 'Divide By', 'DIVIDEBY_DESC' => 'Divide by columns number.',
274276
'TABLE_TYPE' => 'Table Type', 'TABLE_TYPE_DESC' => 'Table Type is the bootstrap html table.', 'PANEL_TYPE' => 'Panel Type', 'PANEL_TYPE_DESC' => 'Panel Type is the bootstrap html div.', 'IDPAYPAL' => 'Paypal ID', 'IDPAYPAL_DESC' => 'Insert here your PayPal ID for donactions.', 'ADVERTISE' => 'Advertisement Code', 'ADVERTISE_DESC' => 'Insert here the advertisement code', 'MAINTAINEDBY' => 'Maintained By', 'MAINTAINEDBY_DESC' => 'Allow url of support site or community', 'BOOKMARKS' => 'Social Bookmarks', 'BOOKMARKS_DESC' => 'Show Social Bookmarks in the single page', 'FACEBOOK_COMMENTS' => 'Facebook comments', 'FACEBOOK_COMMENTS_DESC' => 'Allow Facebook comments in the single page', 'DISQUS_COMMENTS' => 'Disqus comments', 'DISQUS_COMMENTS_DESC' => 'Allow Disqus comments in the single page',
@@ -378,7 +380,7 @@ public function render()
378380
//if (in_array(1, $tableBlocks)) {
379381
$content .= $this->getLanguageBlocks($tables, $language);
380382
//}
381-
$content .= $this->getLanguageConfig($language, $table);
383+
$content .= $this->getLanguageConfig($language, $tables);
382384
if (in_array(1, $tableNotifications)) {
383385
$content .= $this->getLanguageNotifications($language, $tableSoleName);
384386
}

docs/changelog.txt

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,38 @@
1+
=================================================
2+
2018/03/27: Version 1.91 alpha 3.6 [NOT RELEASED]
3+
=================================================
4+
- change from adminMenu to adminObject (mamba)
5+
- buttons on left (mamba)
6+
- replace static calls (mamba)
7+
- fix statistics (mamba)
8+
- implemented yoda in file creation (goffy)
9+
- css corrections (goffy)
10+
- yoda corrections (goffy)
11+
- corrected css for templates admin tables/fields (goffy)
12+
- replace <br /> by <br>; changed also function TDMCreateHTMLCode, TDMCreateHTMLSmartyCode (goffy)
13+
- corrected typing errors (e.g. getVat) (goffy)
14+
- removed unnecessary semicolons in js (goffy)
15+
- added PHPDocs (goffy)
16+
- replace double quote in language define by single quote; changed also function getXcTplDisplay, getDefine (goffy)
17+
- removed unnecessary closing tag (img) (goffy)
18+
- changed getXcLoadLanguage (include moduledir) (goffy)
19+
- cosmetics (goffy)
20+
- changed comparision to stict (===) (goffy)
21+
- solved wrong string concatenate (goffy)
22+
- Update README.md (timgno)
23+
- fixed notification of no return value from php code inspection (goffy)
24+
- XoopsFormTextDateSelect: created var for isNew was not used (goffy)
25+
- Class files - getValues... function: changed from {fieldname} to {tablename}Obj (goffy)
26+
- Class files - getForm: added field names to comment lines (goffy)
27+
- Creation of xoopsversion.php: config was based on last table (goffy)
28+
- config name for xoopseditorhandler was too long (goffy)
29+
- corrected case mismatch: xoops_gethandler into xoops_getHandler (goffy)
30+
- unnecessary parentheses: removed brackets (goffy)
31+
- unnecessary double quotes (goffy)
32+
- fixed bug in function getValuesInObject (wrong object name) (goffy)
33+
- creation of form: replaced XoopsFormButton by XoopsFormButtonTray (goffy)
34+
- LanguageModinfo.php: Config items have been created only by fields of last table; changed to all tables (goffy)
35+
136
=================================
237
1.91 alpha 3.5 [NOT RELEASED]
338
=================================

xoops_version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
$moduleDirName = basename(__DIR__);
2727

2828
$modversion['version'] = 1.91;
29-
$modversion['module_status'] = 'Alpha 3.5';
29+
$modversion['module_status'] = 'Alpha 3.6';
3030
$modversion['release_date'] = '2017/07/07';
3131
$modversion['name'] = _MI_TDMCREATE_NAME;
3232
$modversion['description'] = _MI_TDMCREATE_DESC;

0 commit comments

Comments
 (0)