Permalink
Browse files

Refactored code for line 199-209

  • Loading branch information...
1 parent a1a8472 commit a7d1237e3229c4c5425f8349847f9bd4b57f74fc @prakul committed Apr 6, 2012
Showing with 10 additions and 10 deletions.
  1. +10 −10 tbl_structure.php
View
20 tbl_structure.php
@@ -192,19 +192,19 @@
} else {
echo '"table" />';
} ?>
-
+
+ $tbl_struc_class =array("column","type","collation","attributes","null","default","extra");
+ $tbl_struc_caption = array("Name","Type","Collation","Attributes","Null","Default","Extra");
+
+
<table id="tablestructure" class="data">
<thead>
<tr>
- <th id="th<?php echo ++$i; ?>"></th>
- <th id="th<?php echo ++$i; ?>">#</th>
- <th id="th<?php echo ++$i; ?>" class="column"><?php echo __('Name'); ?></th>
- <th id="th<?php echo ++$i; ?>" class="type"><?php echo __('Type'); ?></th>
- <th id="th<?php echo ++$i; ?>" class="collation"><?php echo __('Collation'); ?></th>
- <th id="th<?php echo ++$i; ?>" class="attributes"><?php echo __('Attributes'); ?></th>
- <th id="th<?php echo ++$i; ?>" class="null"><?php echo __('Null'); ?></th>
- <th id="th<?php echo ++$i; ?>" class="default"><?php echo __('Default'); ?></th>
- <th id="th<?php echo ++$i; ?>" class="extra"><?php echo __('Extra'); ?></th>
+ foreach($tbl_struc_class as $i=>$value))
+ {
+ echo " <th id=\"th$i\" class=\"$tbl_struc_class[$i]\" > __('$tbl_struc_caption[$i]') </th>" ;
+
+ }
<?php if ($db_is_information_schema || $tbl_is_view) { ?>
<th id="th<?php echo ++$i; ?>" class="view"><?php echo __('View'); ?></th>
<?php } else { ?>

2 comments on commit a7d1237

@lem9

Prakul,
you have not refreshed your repository; your patch does not apply to the current state of tbl_structure.php (as changed on March 24).

@nijel

This change would break localization (extracting of strings to translate). You should use __('') while filling up the array (as mentioned on mailing list).

Please sign in to comment.