@@ -201,9 +201,9 @@ public function getSmartyIncludeFile($moduleDirname, $fileName = 'header', $admi
201201 * @param string $n
202202 * @return string
203203 */
204- public function getSmartyIncludeFileListSection ($ moduleDirname , $ fileName , $ tableFieldName , $ t = '' , $ n = '' )
204+ public function getSmartyIncludeFileListSection ($ moduleDirname , $ fileName , $ itemName , $ arrayName , $ t = '' , $ n = '' )
205205 {
206- return "{$ t }<{include file='db: {$ moduleDirname }_ {$ fileName }_list.tpl' {$ tableFieldName }= \${$ tableFieldName }[i]}> {$ n }" ;
206+ return "{$ t }<{include file='db: {$ moduleDirname }_ {$ fileName }_list.tpl' {$ itemName }= \${$ arrayName }[i]}> {$ n }" ;
207207 }
208208
209209 /**
@@ -233,31 +233,28 @@ public function getSmartyIncludeFileListForeach($moduleDirname, $fileName, $tabl
233233 * @param string $n
234234 * @return string
235235 */
236- public function getSmartyConditions ($ condition = '' , $ operator = '' , $ type = '' , $ contentIf = '' , $ contentElse = false , $ count = false , $ noSimbol = false , $ t = '' , $ n = "\n" )
236+ public function getSmartyConditions ($ condition = '' , $ operator = '' , $ type = '' , $ contentIf = '' , $ contentElse = false , $ count = false , $ noSimbol = false , $ t = '' , $ n = "\n" , $ split = true )
237237 {
238- if (! $ contentElse ) {
239- if (! $ count ) {
240- $ ret = "{ $ t } <{if \${ $ condition }{ $ operator }{ $ type } }> { $ n }" ;
241- } elseif (! $ noSimbol ) {
242- $ ret = "{ $ t } <{if { $ condition }{ $ operator }{ $ type } }> { $ n }" ;
243- } else {
244- $ ret = "{ $ t } <{ if count( \${ $ condition } ) { $ operator }{ $ type } }> { $ n }" ;
245- }
246- $ ret .= "{ $ contentIf }" ;
247- $ ret . = "{$ t }<{/if} > {$ n }" ;
238+ $ ns = '' ;
239+ $ ts = '' ;
240+ if ( $ split ) {
241+ $ ns = $ n ;
242+ $ ts = $ t ;
243+ }
244+ if (! $ count ) {
245+ $ ret = "{ $ t } <{if \${ $ condition }{ $ operator }{ $ type } }> { $ ns }" ;
246+ } elseif (! $ noSimbol ) {
247+ $ ret = "{$ t }<{if { $ condition }{ $ operator }{ $ type } } > {$ ns }" ;
248248 } else {
249- if (!$ count ) {
250- $ ret = "{$ t }<{if \${$ condition }{$ operator }{$ type }}> {$ n }" ;
251- } elseif (!$ noSimbol ) {
252- $ ret = "{$ t }<{if {$ condition }{$ operator }{$ type }}> {$ n }" ;
253- } else {
254- $ ret = "{$ t }<{if count( \${$ condition }) {$ operator }{$ type }}> {$ n }" ;
255- }
256- $ ret .= "{$ contentIf }" ;
257- $ ret .= "{$ t }<{else}> {$ n }" ;
249+ $ ret = "{$ t }<{if count( \${$ condition }) {$ operator }{$ type }}> {$ ns }" ;
250+ }
251+ $ ret .= "{$ contentIf }" ;
252+ if ($ contentElse ) {
253+ $ ret .= "{$ ts }<{else}> {$ ns }" ;
258254 $ ret .= "{$ contentElse }" ;
259- $ ret .= "{$ t }<{/if}> {$ n }" ;
260255 }
256+ $ ret .= "{$ ts }<{/if}> {$ n }" ;
257+
261258
262259 return $ ret ;
263260 }
0 commit comments