@@ -79,7 +79,7 @@ public function getTemplateUserIndexHeader($moduleDirname)
7979 {
8080 $ sc = Tdmcreate \Files \CreateSmartyCode::getInstance ();
8181
82- return $ sc ->getSmartyIncludeFile ($ moduleDirname , 'header ' ) . PHP_EOL ;
82+ return $ sc ->getSmartyIncludeFile ($ moduleDirname , 'header ' , false , false , '' , "\n" ) ;
8383 }
8484
8585 /**
@@ -98,7 +98,7 @@ private function getTemplatesUserIndexTable($moduleDirname, $tableName, $tableSo
9898 $ table = $ this ->getTemplatesUserIndexTableThead ($ tableName , $ language );
9999 $ table .= $ this ->getTemplatesUserIndexTableTBody ($ moduleDirname , $ tableName , $ tableSoleName );
100100
101- return $ hc ->getHtmlTable ($ table , 'table table- ' . $ single ) . PHP_EOL ;
101+ return $ hc ->getHtmlTable ($ table , 'table table- ' . $ single );
102102 }
103103
104104 /**
@@ -114,10 +114,10 @@ private function getTemplatesUserIndexTableThead($tableName, $language)
114114 $ stuTableName = mb_strtoupper ($ tableName );
115115 $ lang = $ sc ->getSmartyConst ($ language , $ stuTableName );
116116 $ col = $ sc ->getSmartySingleVar ('numb_col ' );
117- $ th = $ hc ->getHtmlTableHead ($ lang , '' , $ col ) . PHP_EOL ;
118- $ tr = $ hc ->getHtmlTableRow ($ th , 'head ' ) . PHP_EOL ;
117+ $ th = $ hc ->getHtmlTableHead ($ lang , '' , $ col );
118+ $ tr = $ hc ->getHtmlTableRow ($ th , 'head ' ) ;
119119
120- return $ hc ->getHtmlTableThead ($ tr ) . PHP_EOL ;
120+ return $ hc ->getHtmlTableThead ($ tr );
121121 }
122122
123123 /**
@@ -134,13 +134,13 @@ private function getTemplatesUserIndexTableTBody($moduleDirname, $tableName, $ta
134134 $ type = $ sc ->getSmartySingleVar ('panel_type ' );
135135 $ include = $ sc ->getSmartyIncludeFileListForeach ($ moduleDirname , $ tableName , $ tableSoleName );
136136 $ div = $ hc ->getHtmlDiv ($ include , 'panel panel- ' . $ type );
137- $ cont = $ hc ->getHtmlTableData ($ div ) . PHP_EOL ;
138- $ html = $ hc ->getHtmlEmpty ('</tr><tr> ' ) . PHP_EOL ;
139- $ cont .= $ sc ->getSmartyConditions ($ tableSoleName . '.count ' , ' is div by ' , '$divideby ' , $ html ) . PHP_EOL ;
140- $ foreach = $ sc ->getSmartyForeach ($ tableSoleName , $ tableName , $ cont ) . PHP_EOL ;
141- $ tr = $ hc ->getHtmlTableRow ($ foreach ) . PHP_EOL ;
137+ $ cont = $ hc ->getHtmlTableData ($ div );
138+ $ html = $ hc ->getHtmlEmpty ('</tr><tr> ' );
139+ $ cont .= $ sc ->getSmartyConditions ($ tableSoleName . '.count ' , ' is div by ' , '$divideby ' , $ html );
140+ $ foreach = $ sc ->getSmartyForeach ($ tableSoleName , $ tableName , $ cont );
141+ $ tr = $ hc ->getHtmlTableRow ($ foreach );
142142
143- return $ hc ->getHtmlTableTbody ($ tr ) . PHP_EOL ;
143+ return $ hc ->getHtmlTableTbody ($ tr );
144144 }
145145
146146 /**
@@ -150,10 +150,10 @@ private function getTemplatesUserIndexTableTBody($moduleDirname, $tableName, $ta
150150 private function getTemplatesUserIndexTableTfoot ()
151151 {
152152 $ hc = Tdmcreate \Files \CreateHtmlCode::getInstance ();
153- $ td = $ hc ->getHtmlTableData (' ' ) . PHP_EOL ;
154- $ tr = $ hc ->getHtmlTableRow ($ td ) . PHP_EOL ;
153+ $ td = $ hc ->getHtmlTableData (' ' );
154+ $ tr = $ hc ->getHtmlTableRow ($ td );
155155
156- return $ hc ->getHtmlTableTfoot ($ tr ) . PHP_EOL ;
156+ return $ hc ->getHtmlTableTfoot ($ tr );
157157 }
158158
159159 /**
@@ -165,9 +165,50 @@ private function getTemplatesUserIndexTableTfoot()
165165 */
166166 public function getTemplatesUserIndexBodyDefault ($ module , $ table , $ language )
167167 {
168+ $ hc = Tdmcreate \Files \CreateHtmlCode::getInstance ();
169+ $ sc = Tdmcreate \Files \CreateSmartyCode::getInstance ();
168170 $ moduleDirname = $ module ->getVar ('mod_dirname ' );
169171 $ tableName = $ table ->getVar ('table_name ' );
170- $ ret = <<<EOT
172+ $ th = $ hc ->getHtmlTableHead ("<{ \$smarty.const. {$ language }TITLE}> - <{ \$smarty.const. {$ language }DESC}> " , '' , '' ,"\t\t\t" );
173+ $ tr = $ hc ->getHtmlTableRow ($ th ,'center ' ,"\t\t" );
174+ $ thead = $ hc ->getHtmlTableThead ($ tr ,'' , "\t" );
175+ $ contTable = $ thead ;
176+ $ li = $ hc ->getHtmlLi ("<a href= \"<{ \${$ moduleDirname }_url}> \"><{ \$smarty.const. {$ language }INDEX}></a> " ,'' ,"\t\t\t\t\t\t" );
177+ $ tables = $ this ->getTableTables ($ module ->getVar ('mod_id ' ), 'table_order ' );
178+ foreach (array_keys ($ tables ) as $ i ) {
179+ $ tableNameLi = $ tables [$ i ]->getVar ('table_name ' );
180+ $ stuTableNameLi = mb_strtoupper ($ tableName );
181+ $ li .= $ hc ->getHtmlLi ("<a href= \"<{ \${$ moduleDirname }_url}>/ {$ tableNameLi }.php \"><{ \$smarty.const. {$ language }{$ stuTableNameLi }}></a> " ,'' ,"\t\t\t\t\t\t" );
182+ }
183+
184+ $ ul = $ hc ->getHtmlUl ($ li ,'menu text-center ' ,"\t\t\t\t\t" );
185+ $ td = $ hc ->getHtmlTableData ($ ul , 'bold pad5 ' ,'' ,"\t\t\t\t" , "\n" , true );
186+ $ tr = $ hc ->getHtmlTablerow ($ td , 'center ' ,"\t\t\t" );
187+
188+ $ tbody = $ hc ->getHtmlTableTbody ($ tr ,'' , "\t\t" );
189+ $ contTable .= $ tbody ;
190+
191+ $ tfoot = <<<EOT
192+
193+ <tfoot>
194+ <{if \$adv != ''}>
195+ <tr class="center"><td class="center bold pad5"><{ \$adv}></td></tr>
196+ <{else}>
197+ <tr class="center"><td class="center bold pad5"> </td></tr>
198+ <{/if}>
199+ </tfoot>
200+ EOT ;
201+
202+
203+ $ contTable .= $ tfoot ;
204+ $ contIf = $ hc ->getHtmlTable ($ contTable );
205+ $ ret = $ sc ->getSmartyConditions ("{$ tableName }Count " , ' > ' , '0 ' , $ contIf , false , '' ,'' ,"\t" );
206+
207+
208+ $ ret .= '' ;
209+ $ ret .= '********************************************************* ' ;
210+
211+ $ ret .= <<<EOT
171212<{if \${$ tableName }Count == 0}>
172213<table class="table table-<{ \$table_type}>">
173214 <thead>
@@ -332,6 +373,7 @@ public function render()
332373 if (in_array (1 , $ tableCategory , true ) && in_array (1 , $ tableIndex )) {
333374 $ content .= $ this ->getTemplateUserIndexCategories ($ moduleDirname , $ tableName , $ tableSoleName , $ language );
334375 }
376+
335377 if (in_array (0 , $ tableCategory , true ) && in_array (1 , $ tableIndex )) {
336378 $ content .= $ this ->getTemplateUserIndexTable ($ moduleDirname , $ tableName , $ tableSoleName , $ language );
337379 }
0 commit comments