@@ -87,25 +87,25 @@ private function getBlocksShow($moduleDirname, $tableName, $tableFieldname, $fie
8787 $ ucfTableName = ucfirst ($ tableName );
8888 $ critName = 'cr ' . $ ucfTableName ;
8989
90- $ ret = $ pc ->getPhpCodeCommentMultiLine (['Function ' => 'show block ' , '@param $options ' => '' , '@return ' => 'form ' ]);
90+ $ ret = $ pc ->getPhpCodeCommentMultiLine (['Function ' => 'show block ' , '@param $options ' => '' , '@return ' => 'array ' ]);
9191
9292 $ func = $ pc ->getPhpCodeIncludeDir ("XOOPS_ROOT_PATH . '/modules/ {$ moduleDirname }/class/ {$ tableName }.php' " ,'' ,true , true , '' , "\t" );
9393 $ func .= $ xc ->getXcEqualsOperator ('$myts ' , 'MyTextSanitizer::getInstance() ' , '' ,'' , "\t" );
9494 $ func .= $ xc ->getXcXoopsTplAssign ("{$ moduleDirname }_upload_url " ,"{$ stuModuleDirname }_UPLOAD_URL " ,'' ,"\t" );
95- $ func .= $ xc ->getXcEqualsOperator ('$block ' , '[] ' , '' ,'' , "\t" );
96- $ func .= $ xc ->getXcEqualsOperator ('$typeBlock ' , '$options[0] ' ,'' ,'' , "\t" );
97- $ func .= $ xc ->getXcEqualsOperator ('$limit ' , '$options[1] ' ,'' ,'' , "\t" );
98- $ func .= $ xc ->getXcEqualsOperator ('$lenghtTitle ' , '$options[2] ' ,'' ,'' , "\t" );
99- $ func .= $ xc ->getXcEqualsOperator ('$helper ' , 'Helper::getInstance() ' ,'' ,'' , "\t" );
100- $ func .= $ xc ->getXcEqualsOperator ( "\${ $ tableName} Handler " , "\$ helper->getHandler(' { $ tableName } ') " , null , true , "\t" );
95+ $ func .= $ xc ->getXcEqualsOperator ('$block ' , '[] ' , '' ,"\t" );
96+ $ func .= $ xc ->getXcEqualsOperator ('$typeBlock ' , '$options[0] ' ,'' ,"\t" );
97+ $ func .= $ xc ->getXcEqualsOperator ('$limit ' , '$options[1] ' ,'' ,"\t" );
98+ $ func .= $ xc ->getXcEqualsOperator ('$lenghtTitle ' , '$options[2] ' ,'' ,"\t" );
99+ $ func .= $ xc ->getXcEqualsOperator ('$helper ' , 'Helper::getInstance() ' ,'' ,"\t" );
100+ $ func .= $ xc ->getXcHandlerLine ( $ tableName , "\t" );
101101 $ func .= $ xc ->getXcCriteriaCompo ($ critName , "\t" );
102102 $ func .= $ pc ->getPhpCodeArrayShift ('$options ' , "\t" );
103103 $ func .= $ pc ->getPhpCodeArrayShift ('$options ' , "\t" );
104104 $ func .= $ pc ->getPhpCodeArrayShift ('$options ' , "\t" );
105105 $ func .= $ pc ->getPhpCodeBlankLine ();
106106
107107 //content if: parent
108- $ contIf = $ xc ->getXcEqualsOperator ("\${$ tableName }" , "{$ moduleDirname }_getMyItemIds(' {$ moduleDirname }_view', ' {$ moduleDirname }') " , null , false , "\t" );
108+ $ contIf = $ xc ->getXcEqualsOperator ("\${$ tableName }" , "{$ moduleDirname }_getMyItemIds(' {$ moduleDirname }_view', ' {$ moduleDirname }') " , null , "\t" );
109109 $ crit = $ xc ->getXcCriteria ('' , "'cid' " , "'(' . implode(',', \${$ tableName }) . ')' " , "'IN' " , true );
110110 $ contIf .= $ xc ->getXcCriteriaAdd ($ critName , $ crit , "\t" );
111111 $ crit = $ xc ->getXcCriteria ('' , "' {$ fieldId }' " , "{$ moduleDirname }_block_addCatSelect( \$options) " , "'IN' " , true );
@@ -135,17 +135,17 @@ private function getBlocksShow($moduleDirname, $tableName, $tableFieldname, $fie
135135 if ('' !== $ fieldStatus ) {
136136 $ case1 [] = $ critStatus ;
137137 }
138- $ case1 [] = $ xc ->getXcCriteriaSetSort ($ critName , "' {$ tableFieldname }_created ' " ,"\t\t\t" );
138+ $ case1 [] = $ xc ->getXcCriteriaSetSort ($ critName , "' {$ tableFieldname }_date ' " ,"\t\t\t" );
139139 $ case1 [] = $ xc ->getXcCriteriaSetOrder ($ critName , "'DESC' " ,"\t\t\t" );
140140 $ case2 [] = $ pc ->getPhpCodeCommentLine ("For the block: {$ tableName } new " ,'' ,"\t\t\t" );
141141 if ('' !== $ fieldStatus ) {
142142 $ case2 [] = $ critStatus ;
143143 }
144- $ crit = $ xc ->getXcCriteria ('' , "' {$ tableFieldname }_created ' " , 'strtotime(date(_SHORTDATESTRING)) ' , "'>=' " , true );
144+ $ crit = $ xc ->getXcCriteria ('' , "' {$ tableFieldname }_date ' " , 'strtotime(date(_SHORTDATESTRING)) ' , "'>=' " , true );
145145 $ case2 [] = $ xc ->getXcCriteriaAdd ($ critName , $ crit ,"\t\t\t" );
146- $ crit = $ xc ->getXcCriteria ('' , "' {$ tableFieldname }_created ' " , 'strtotime(date(_SHORTDATESTRING))+86400 ' , "'<=' " , true );
146+ $ crit = $ xc ->getXcCriteria ('' , "' {$ tableFieldname }_date ' " , 'strtotime(date(_SHORTDATESTRING))+86400 ' , "'<=' " , true );
147147 $ case2 [] = $ xc ->getXcCriteriaAdd ($ critName , $ crit ,"\t\t\t" );
148- $ case2 [] = $ xc ->getXcCriteriaSetSort ($ critName , "' {$ tableFieldname }_created ' " ,"\t\t\t" );
148+ $ case2 [] = $ xc ->getXcCriteriaSetSort ($ critName , "' {$ tableFieldname }_date ' " ,"\t\t\t" );
149149 $ case2 [] = $ xc ->getXcCriteriaSetOrder ($ critName , "'ASC' " ,"\t\t\t" );
150150 $ case3 [] = $ pc ->getPhpCodeCommentLine ("For the block: {$ tableName } hits " ,'' ,"\t\t\t" );
151151 if ('' !== $ fieldStatus ) {
@@ -196,20 +196,20 @@ private function getBlocksShow($moduleDirname, $tableName, $tableFieldname, $fie
196196 if (1 == $ fields [$ f ]->getVar ('field_block ' )) {
197197 switch ($ fieldElement ) {
198198 case 2 :
199- $ contentForeach .= $ xc ->getXcEqualsOperator ("\$block[ \$i][' {$ rpFieldName }'] " , "\$myts->htmlSpecialChars( \${$ tableName }All[ \$i]->getVar(' {$ fieldName }')) " , null , false , "\t\t\t" );
199+ $ contentForeach .= $ xc ->getXcEqualsOperator ("\$block[ \$i][' {$ rpFieldName }'] " , "\$myts->htmlSpecialChars( \${$ tableName }All[ \$i]->getVar(' {$ fieldName }')) " , null , "\t\t\t" );
200200 break ;
201201 case 3 :
202202 case 4 :
203- $ contentForeach .= $ xc ->getXcEqualsOperator ("\$block[ \$i][' {$ rpFieldName }'] " , "strip_tags( \${$ tableName }All[ \$i]->getVar(' {$ fieldName }')) " , null , false , "\t\t\t" );
203+ $ contentForeach .= $ xc ->getXcEqualsOperator ("\$block[ \$i][' {$ rpFieldName }'] " , "strip_tags( \${$ tableName }All[ \$i]->getVar(' {$ fieldName }')) " , null , "\t\t\t" );
204204 break ;
205205 case 8 :
206- $ contentForeach .= $ xc ->getXcEqualsOperator ("\$block[ \$i][' {$ rpFieldName }'] " , "\XoopsUser::getUnameFromId( \${$ tableName }All[ \$i]->getVar(' {$ fieldName }')) " , null , false , "\t\t\t" );
206+ $ contentForeach .= $ xc ->getXcEqualsOperator ("\$block[ \$i][' {$ rpFieldName }'] " , "\XoopsUser::getUnameFromId( \${$ tableName }All[ \$i]->getVar(' {$ fieldName }')) " , null , "\t\t\t" );
207207 break ;
208208 case 15 :
209- $ contentForeach .= $ xc ->getXcEqualsOperator ("\$block[ \$i][' {$ rpFieldName }'] " ,"formatTimeStamp( \${$ tableName }All[ \$i]->getVar(' {$ fieldName }')) " , null , false , "\t\t\t" );
209+ $ contentForeach .= $ xc ->getXcEqualsOperator ("\$block[ \$i][' {$ rpFieldName }'] " ,"formatTimeStamp( \${$ tableName }All[ \$i]->getVar(' {$ fieldName }')) " , null , "\t\t\t" );
210210 break ;
211211 default :
212- $ contentForeach .= $ xc ->getXcEqualsOperator ("\$block[ \$i][' {$ rpFieldName }'] " ,"\${$ tableName }All[ \$i]->getVar(' {$ fieldName }') " , null , false , "\t\t\t" );
212+ $ contentForeach .= $ xc ->getXcEqualsOperator ("\$block[ \$i][' {$ rpFieldName }'] " ,"\${$ tableName }All[ \$i]->getVar(' {$ fieldName }') " , null , "\t\t\t" );
213213 break ;
214214 }
215215 }
@@ -245,15 +245,15 @@ private function getBlocksEdit($moduleDirname, $tableName, $fieldId, $fieldMain,
245245 $ ucfTableName = ucfirst ($ tableName );
246246 $ critName = 'cr ' . $ ucfTableName ;
247247
248- $ ret = $ pc ->getPhpCodeCommentMultiLine (['Function ' => 'edit block ' , '@param $options ' => '' , '@return ' => 'form ' ]);
248+ $ ret = $ pc ->getPhpCodeCommentMultiLine (['Function ' => 'edit block ' , '@param $options ' => '' , '@return ' => 'string ' ]);
249249 $ func = $ pc ->getPhpCodeIncludeDir ("XOOPS_ROOT_PATH . '/modules/ {$ moduleDirname }/class/ {$ tableName }.php' " ,'' ,true , true , '' , "\t" );
250- $ func .= $ xc ->getXcEqualsOperator ('$helper ' , 'Helper::getInstance() ' , '' ,'' , "\t" );
251- $ func .= $ xc ->getXcEqualsOperator ( "\${ $ tableName} Handler " , "\$ helper->getHandler(' { $ tableName } ') " , null , true , "\t" );
250+ $ func .= $ xc ->getXcEqualsOperator ('$helper ' , 'Helper::getInstance() ' , '' ,"\t" );
251+ $ func .= $ xc ->getXcHandlerLine ( $ tableName , "\t" );
252252 $ func .= $ xc ->getXcXoopsTplAssign ("{$ moduleDirname }_upload_url " ,"{$ stuModuleDirname }_UPLOAD_URL " ,'' ,"\t" );
253- $ func .= $ xc ->getXcEqualsOperator ('$form ' , "{$ language }DISPLAY " , '' ,'' , "\t" );
254- $ func .= $ xc ->getXcEqualsOperator ('$form ' , "\"<input type='hidden' name='options[0]' value=' \". \$options[0]. \"' /> \"" , '. ' ,false , "\t" );
255- $ func .= $ xc ->getXcEqualsOperator ('$form ' , "\"<input type='text' name='options[1]' size='5' maxlength='255' value=' \" . \$options[1] . \"' /> <br> \"" , '. ' ,false , "\t" );
256- $ func .= $ xc ->getXcEqualsOperator ('$form ' , "{$ language }TITLE_LENGTH . \" : <input type='text' name='options[2]' size='5' maxlength='255' value=' \" . \$options[2] . \"' /><br><br> \"" , '. ' ,false , "\t" );
253+ $ func .= $ xc ->getXcEqualsOperator ('$form ' , "{$ language }DISPLAY " , '' ,"\t" );
254+ $ func .= $ xc ->getXcEqualsOperator ('$form ' , "\"<input type='hidden' name='options[0]' value=' \". \$options[0]. \"' /> \"" , '. ' ,"\t" );
255+ $ func .= $ xc ->getXcEqualsOperator ('$form ' , "\"<input type='text' name='options[1]' size='5' maxlength='255' value=' \" . \$options[1] . \"' /> <br> \"" , '. ' ,"\t" );
256+ $ func .= $ xc ->getXcEqualsOperator ('$form ' , "{$ language }TITLE_LENGTH . \" : <input type='text' name='options[2]' size='5' maxlength='255' value=' \" . \$options[2] . \"' /><br><br> \"" , '. ' ,"\t" );
257257 $ func .= $ pc ->getPhpCodeArrayShift ('$options ' , "\t" );
258258 $ func .= $ pc ->getPhpCodeArrayShift ('$options ' , "\t" );
259259 $ func .= $ pc ->getPhpCodeArrayShift ('$options ' , "\t" );
@@ -265,12 +265,12 @@ private function getBlocksEdit($moduleDirname, $tableName, $fieldId, $fieldMain,
265265 $ func .= $ xc ->getXcCriteriaSetOrder ($ critName , "'ASC' " ,"\t" ,"\n" );
266266 $ func .= $ xc ->getXcHandlerAllClear ("{$ tableName }All " , $ tableName , "\${$ critName }" , "\t" );
267267 $ func .= $ pc ->getPhpCodeUnset ($ critName , "\t" );
268- $ func .= $ xc ->getXcEqualsOperator ('$form ' , "{$ language }{$ stuTableName }_TO_DISPLAY . \"<br><select name='options[]' multiple='multiple' size='5'> \"" , '. ' ,false , "\t" );
269- $ func .= $ xc ->getXcEqualsOperator ('$form ' , "\"<option value='0' \" . (in_array(0, \$options) == false ? '' : \"selected='selected' \") . '>' . {$ language }ALL_ {$ stuTableName } . '</option>' " , '. ' ,false , "\t" );
270- $ contentForeach = $ xc ->getXcEqualsOperator ("\${$ fieldId }" , "\${$ tableName }All[ \$i]->getVar(' {$ fieldId }') " , '' ,'' , "\t\t" );
271- $ contentForeach .= $ xc ->getXcEqualsOperator ('$form ' , "\"<option value=' \" . \${$ fieldId } . \"' \" . (in_array( \${$ fieldId }, \$options) == false ? '' : \"selected='selected' \") . '>' . \${$ tableName }All[ \$i]->getVar(' {$ fieldMain }') . '</option>' " , '. ' ,false , "\t\t" );
268+ $ func .= $ xc ->getXcEqualsOperator ('$form ' , "{$ language }{$ stuTableName }_TO_DISPLAY . \"<br><select name='options[]' multiple='multiple' size='5'> \"" , '. ' ,"\t" );
269+ $ func .= $ xc ->getXcEqualsOperator ('$form ' , "\"<option value='0' \" . (in_array(0, \$options) == false ? '' : \"selected='selected' \") . '>' . {$ language }ALL_ {$ stuTableName } . '</option>' " , '. ' ,"\t" );
270+ $ contentForeach = $ xc ->getXcEqualsOperator ("\${$ fieldId }" , "\${$ tableName }All[ \$i]->getVar(' {$ fieldId }') " , '' ,"\t\t" );
271+ $ contentForeach .= $ xc ->getXcEqualsOperator ('$form ' , "\"<option value=' \" . \${$ fieldId } . \"' \" . (in_array( \${$ fieldId }, \$options) == false ? '' : \"selected='selected' \") . '>' . \${$ tableName }All[ \$i]->getVar(' {$ fieldMain }') . '</option>' " , '. ' ,"\t\t" );
272272 $ func .= $ pc ->getPhpCodeForeach ("{$ tableName }All " , true , false , 'i ' , $ contentForeach , "\t" );
273- $ func .= $ xc ->getXcEqualsOperator ('$form ' , "'</select>' " , '. ' ,false , "\t" );
273+ $ func .= $ xc ->getXcEqualsOperator ('$form ' , "'</select>' " , '. ' ,"\t" );
274274 $ func .= $ pc ->getPhpCodeBlankLine ();
275275 $ func .= $ this ->getSimpleString ('return $form; ' , "\t" );
276276 $ func .= $ pc ->getPhpCodeBlankLine ();
0 commit comments