Currently, the width of Label column and the width of Data column in View, Edit, and Add Pages of websites that generated with PHPMaker 9 has not been standarized. Thus, you will find that the columns width can be different between one and another pages. This is not a good condition and it is not consistent.
To overcome this problem, here is the modification I created. I have successfully customized PHPMaker template files in order to make the Label column width and the Data column width become consistent and standardized. I added two constants in the configuration (ewcfg9.php) file so that you can easily adjust the width of Label and Data columns in the percentage values.
As a result, this will make your users feel comfortable while browsing your Add, Edit, and View pages of your web application.
Updated on July 22, 2012: This customization has been implemented in PHPMaker version 9.0.3, it matches to each other, and as a result, it works properly.
Updated on September 5, 2012: This customization has been implemented in PHPMaker version 9.0.4, it matches to each other, and as a result, it works properly.
Updated on November 29, 2012: This customization has been implemented in PHPMaker version 9.1.0, it matches to each other, and as a result, it works properly.
Updated on February 9, 2013: This customization has been implemented in PHPMaker version 9.2.0, it matches to each other, and as a result, it works properly.
Updated on June 17, 2013: This customization below has been handled by using MasinoFixedWidthSite extension. You don’t need to implement the customization below if you use my extensions together with the original PHPMaker Template and Extension files.
[hidepost]
-
Open your \Script\ewcfg.php file, and find this code:
// General
before that line, please insert the following code:
// Begin of modification Label and Data column width in Add, Edit, and View pages, by Masino Sinaga, May 31, 2012 define("MS_LABEL_COLUMN_WIDTH", 30, TRUE); // in percentage define("MS_DATA_COLUMN_WIDTH", 70, TRUE); // in percentage // End of modification Label and Data column width in Add, Edit, and View pages, by Masino Sinaga, May 31, 2012
-
Open your \Script\add-script.php file, and find this code for PHPMaker version < 9.1.0:
[code lang="php"]
> ->CellAttributes() ?>>->CustomMsg ?> [/code]
and if you are using PHPMaker version >= 9.1.0, then find this code:
<td<!--##=ewCSSTableHeaderClass##-->><span id="<!--##=sHeaderSpanId##-->"><table class="ewTableHeaderBtn"><tr><td><!--##=SYSTEMFUNCTIONS.FieldCaption()##--><!--##=sFldReqInd##--></td></tr></table></span></td> <td<?php echo $<!--##=gsFldObj##-->->CellAttributes() ?>><span id="<!--##=sSpanId##-->"><!--##=ctl##--></span><?php echo $<!--##=gsFldObj##-->->CustomMsg ?></td>
then replace it with the following code for PHPMaker version < 9.1.0: [code lang="php"]
width="%"> ->CellAttributes() ?> width="%">->CustomMsg ?> [/code]
or replace it with the following code for PHPMaker version >= 9.1.0:
<td<!--##=ewCSSTableHeaderClass##--> width="<?php echo MS_LABEL_COLUMN_WIDTH; ?>%"><span id="<!--##=sHeaderSpanId##-->"><table class="ewTableHeaderBtn"><tr><td><!--##=SYSTEMFUNCTIONS.FieldCaption()##--><!--##=sFldReqInd##--></td></tr></table></span></td> <td<?php echo $<!--##=gsFldObj##-->->CellAttributes() ?> width="<?php echo MS_DATA_COLUMN_WIDTH; ?>%"><span id="<!--##=sSpanId##-->"><!--##=ctl##--></span><?php echo $<!--##=gsFldObj##-->->CustomMsg ?></td>
-
Open your \Script\edit-script.php file, and find this code for PHPMaker version < 9.1.0:
[code lang="php"]
> ->CellAttributes() ?>>->CustomMsg ?> [/code]
or if you are using PHPMaker version >= 9.1.0, then find this code:
<td<!--##=ewCSSTableHeaderClass##-->><span id="<!--##=sHeaderSpanId##-->"><table class="ewTableHeaderBtn"><tr><td><!--##=SYSTEMFUNCTIONS.FieldCaption()##--><!--##=sFldReqInd##--></td></tr></table></span></td> <td<?php echo $<!--##=gsFldObj##-->->CellAttributes() ?>><span id="<!--##=sSpanId##-->"><!--##=SYSTEMFUNCTIONS.FieldEdit()##--></span><?php echo $<!--##=gsFldObj##-->->CustomMsg ?></td>
then replace it with the following code for PHPMaker version < 9.1.0: [code lang="php"]
width="%"> ->CellAttributes() ?> width="%">->CustomMsg ?> [/code]
or replace it with the following code for PHPMaker version >= 9.1.0:
<td<!--##=ewCSSTableHeaderClass##--> width="<?php echo MS_LABEL_COLUMN_WIDTH; ?>%"><span id="<!--##=sHeaderSpanId##-->"><table class="ewTableHeaderBtn"><tr><td><!--##=SYSTEMFUNCTIONS.FieldCaption()##--><!--##=sFldReqInd##--></td></tr></table></span></td> <td<?php echo $<!--##=gsFldObj##-->->CellAttributes() ?> width="<?php echo MS_DATA_COLUMN_WIDTH; ?>%"><span id="<!--##=sSpanId##-->"><!--##=SYSTEMFUNCTIONS.FieldEdit()##--></span><?php echo $<!--##=gsFldObj##-->->CustomMsg ?></td>
-
Open your \Script\view-script.php file, and find this code for PHPMaker version < 9.1.0:
[code lang="php"]
> ->CellAttributes() ?>> [/code]
or if you are using PHPMaker version >= 9.1.0, then find this code:
<td<!--##=ewCSSTableHeaderClass##-->><span id="<!--##=sHeaderSpanId##-->"><table class="ewTableHeaderBtn"><tr><td><!--##=SYSTEMFUNCTIONS.FieldCaption()##--></td></tr></table></span></td> <td<?php echo $<!--##=gsFldObj##-->->CellAttributes() ?>><span id="<!--##=sSpanId##-->"><!--##=SYSTEMFUNCTIONS.FieldView()##--></span></td>
then replace it with the following code for PHPMaker version < 9.1.0: [code lang="php"]
width="%"> ->CellAttributes() ?> width="%"> [/code]
or replace it with the following code for PHPMaker version >= 9.1.0:
<td<!--##=ewCSSTableHeaderClass##--> width="<?php echo MS_LABEL_COLUMN_WIDTH; ?>%"><span id="<!--##=sHeaderSpanId##-->"><table class="ewTableHeaderBtn"><tr><td><!--##=SYSTEMFUNCTIONS.FieldCaption()##--></td></tr></table></span></td> <td<?php echo $<!--##=gsFldObj##-->->CellAttributes() ?> width="<?php echo MS_DATA_COLUMN_WIDTH; ?>%"><span id="<!--##=sSpanId##-->"><!--##=SYSTEMFUNCTIONS.FieldView()##--></span></td>
-
Bonus: We will also modify the master page. Open your \Script\master-script.php file, and find this code for PHPMaker version < 9.1.0:
[code lang="php"]
> ->CellAttributes() ?>> [/code]
or if you are using PHPMaker version >= 9.1.0, then find this code:
<td<!--##=ewCSSTableHeaderClass##-->><table class="ewTableHeaderBtn"><tr><td><!--##=SYSTEMFUNCTIONS.FieldCaption()##--></td></tr></table></td> <td<?php echo $<!--##=gsFldObj##-->->CellAttributes() ?>><span id="<!--##=sSpanId##-->"><!--##=SYSTEMFUNCTIONS.FieldView()##--></span></td>
then replace it with the following code for PHPMaker version < 9.1.0: [code lang="php"]
width="%"> ->CellAttributes() ?> width="%"> [/code]
or replace it with the following code for PHPMaker version >= 9.1.0:
<td<!--##=ewCSSTableHeaderClass##--> width="<?php echo MS_LABEL_COLUMN_WIDTH; ?>%"><table class="ewTableHeaderBtn"><tr><td><!--##=SYSTEMFUNCTIONS.FieldCaption()##--></td></tr></table></td> <td<?php echo $<!--##=gsFldObj##-->->CellAttributes() ?> width="<?php echo MS_DATA_COLUMN_WIDTH; ?>%"><span id="<!--##=sSpanId##-->"><!--##=SYSTEMFUNCTIONS.FieldView()##--></span></td>
-
Still in that \Script\master-script.php file, find again this code for PHPMaker version < 9.1.0:
[code lang="php"]
> [/code]
or if you are using PHPMaker version >= 9.1.0, then find this code:
<td<!--##=ewCSSTableHeaderClass##-->><table class="ewTableHeaderBtn"><tr><td><!--##=SYSTEMFUNCTIONS.FieldCaption()##--></td></tr></table></td>
then replace it with the following code for PHPMaker version < 9.1.0: [code lang="php"]
width="%"> [/code]
or replace it with the following code for PHPMaker version >= 9.1.0:
<td<!--##=ewCSSTableHeaderClass##--> width="<?php echo MS_LABEL_COLUMN_WIDTH; ?>%"><table class="ewTableHeaderBtn"><tr><td><!--##=SYSTEMFUNCTIONS.FieldCaption()##--></td></tr></table></td>
-
Still in that \Script\master-script.php file, find again this code (both for PHPMaker version < 9.1.0 and >= 9.1.0):
<td<?php echo $<!--##=gsFldObj##-->->CellAttributes() ?>><span id="<!--##=sSpanId##-->"><!--##=SYSTEMFUNCTIONS.FieldView()##--></span></td>
then replace it with the following code:
<td<?php echo $<!--##=gsFldObj##-->->CellAttributes() ?> width="<?php echo MS_DATA_COLUMN_WIDTH; ?>%"><span id="<!--##=sSpanId##-->"><!--##=SYSTEMFUNCTIONS.FieldView()##--></span></td>
- Finally, re-generate all of your script files, using PHPMaker as always.
[/hidepost]
Leave a Reply
You must be logged in to post a comment.