File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ class Table extends FormElement {
3434 var $ mColumns = array (); // array of columns in table
3535 var $ mData = null ; // array of rows with data for column cells
3636 var $ mHeaders = array (); // column headers
37+ var $ mFooters = array (); // column footers
3738 var $ mInteractive = true ; // adds a clickable checkbox column to table
3839 var $ mIAScript = null ; // sctipt to execute when a checkbox is clicked
3940 var $ mKeyField = '' ; // identifies a column used as key to access row data
@@ -110,6 +111,7 @@ function _process() {
110111 foreach ($ this ->mColumns as $ column ) {
111112 $ this ->mColumnFields [] = $ column ->getField ();
112113 $ this ->mHeaders [] = $ column ->getHeader ();
114+ $ this ->mFooters [] = $ column ->getFooter ();
113115 }
114116 }
115117
@@ -176,6 +178,27 @@ function getHtml() {
176178 $ html .= "</tr> \n" ;
177179 }
178180
181+ // Print footers.
182+ if (($ this ->mInteractive && (count ($ this ->mFooters ) > 1 )) || (!$ this ->mInteractive && (count ($ this ->mFooters ) > 0 ))) {
183+ $ html .= "<tr " ;
184+ if (count ($ this ->mRowOptions ) > 0 ) {
185+ foreach ($ this ->mRowOptions as $ k =>$ v ) {
186+ $ html .= " $ k= \"$ v \"" ;
187+ }
188+ }
189+ $ html .= "> \n" ;
190+ foreach ($ this ->mFooters as $ footer ) {
191+ $ html .= "<th " ;
192+ if (count ($ this ->mHeaderOptions ) > 0 ) {
193+ foreach ($ this ->mHeaderOptions as $ k =>$ v ) {
194+ $ html .= " $ k= \"$ v \"" ;
195+ }
196+ }
197+ $ html .= "> $ footer</th> \n" ;
198+ }
199+ $ html .= "</tr> \n" ;
200+ }
201+
179202 $ html .= "</table> " ;
180203 return $ html ;
181204 }
Original file line number Diff line number Diff line change 2828
2929import ('form.DefaultCellRenderer ' );
3030
31+ // TableColumn class represents a single column in a table.
3132class TableColumn {
32- var $ mTitle = "" ;
33+ var $ colHeader = '' ; // Column header.
34+ var $ colFooter = '' ; // Column footer, example: totals in week view.
35+
36+ // TODO: refactoring ongoing down from here.
37+
3338 var $ mIndexField = "" ;
3439 var $ mRenderer = null ;
3540 var $ mWidth = "" ;
3641 var $ mTable = null ;
3742 var $ mBgColor = "#ffffff " ;
3843 var $ mFgColor = "#000000 " ;
3944
40- function __construct ($ indexField , $ title = "" , $ renderer= null ) {
45+ function __construct ($ indexField , $ header = '' , $ renderer = null , $ footer = '' ) {
4146 $ this ->mIndexField = $ indexField ;
42- $ this ->mTitle = $ title ;
47+ $ this ->colHeader = $ header ;
48+ $ this ->colFooter = $ footer ;
4349 if ($ renderer !=null ) {
4450 $ this ->mRenderer = $ renderer ;
4551 } else {
4652 $ this ->mRenderer = new DefaultCellRenderer ();
4753 }
4854 }
4955
50- function getHeader () { return $ this ->mTitle ; }
51-
56+ function getHeader () { return $ this ->colHeader ; }
57+ function getFooter () { return $ this ->colFooter ; }
58+
5259 function getField () { return $ this ->mIndexField ; }
5360
5461 function setTable (&$ table ) { $ this ->mTable = &$ table ; }
Original file line number Diff line number Diff line change 1212 <br >
1313 <table cellspacing =" 0" cellpadding =" 4" width =" 100%" border =" 0" >
1414 <tr >
15- <td align =" center" >  ; Anuko Time Tracker 1.12.3.3689 | Copyright © ; <a href =" https://www.anuko.com/lp/tt_3.htm" target =" _blank" >Anuko</a > |
15+ <td align =" center" >  ; Anuko Time Tracker 1.12.3.3690 | Copyright © ; <a href =" https://www.anuko.com/lp/tt_3.htm" target =" _blank" >Anuko</a > |
1616 <a href =" https://www.anuko.com/lp/tt_4.htm" target =" _blank" >{ $i18n .footer.credits} </a > |
1717 <a href =" https://www.anuko.com/lp/tt_5.htm" target =" _blank" >{ $i18n .footer.license} </a > |
1818 <a href =" https://www.anuko.com/lp/tt_7.htm" target =" _blank" >{ $i18n .footer.improve} </a >
You can’t perform that action at this time.
0 commit comments