* $columns = array(
* column_id => array(
* 'title' => Column heading,
+ * 'class' => The class to apply on the column cells,
* 'field' => Field name for $tabledata->fields[...],
* 'help' => Help page for this column,
* ), ...
if (sizeof($actions) > 0) echo "<th class=\"data\" colspan=\"", count($actions), "\">{$column['title']}</th>\n";
break;
default:
- echo "<th class=\"data\">";
+ echo "<th class=\"data {$column['class']}\">";
if (isset($column['help']))
$this->printHelp($column['title'], $column['help']);
else
foreach ($columns as $column_id => $column) {
+ $class = $column['class'] !== '' ? " class=\"{$column['class']}\"":'';
+
// Apply default values for missing parameters
if (isset($column['url']) && !isset($column['vars'])) $column['vars'] = array();
if (isset($action['disable']) && $action['disable'] === true) {
echo "<td></td>\n";
} else {
- echo "<td class=\"opbutton{$id}\">";
+ echo "<td class=\"opbutton{$id} {$column['class']}\">";
$action['fields'] = $tabledata->fields;
$this->printLink($action);
echo "</td>\n";
}
break;
case 'comment':
- echo "<td class='comment'>";
+ echo "<td class='comment_cell'>";
$val = value($column['field'], $tabledata->fields);
if (!is_null($val)) {
echo $val;
echo "</td>";
break;
default:
- echo "<td>";
+ echo "<td{$class}>";
$val = value($column['field'], $tabledata->fields);
if (!is_null($val)) {
if (isset($column['url'])) {
),
'keyprop' => array(
'title' => $lang['strconstraints'],
+ 'class' => 'constraint_cell',
'field' => field('attname'),
'type' => 'callback',
'params'=> array(
),
'comment' => array(
'title' => $lang['strcomment'],
- 'field' => field('comment'),
+ 'field' => field('comment')
),
);
if ($c['p_field'] == $s)
switch ($c['contype']) {
case 'p':
- $str .= '<a class="img" href="constraints.php?'. $misc->href ."&table=". urlencode($c['p_table']) ."&schema=". urlencode($c['p_schema']) ."\"><img src=\"".
+ $str .= '<a href="constraints.php?'. $misc->href ."&table=". urlencode($c['p_table']) ."&schema=". urlencode($c['p_schema']) ."\"><img src=\"".
$misc->icon('PrimaryKey') .'" alt="[pk]" title="'. htmlentities($c['consrc'], ENT_QUOTES, 'UTF-8') .'" /></a>';
break;
case 'f':
- $str .= '<a class="img" href="tblproperties.php?'. $misc->href ."&table=". urlencode($c['f_table']) ."&schema=". urlencode($c['f_schema']) ."\"><img src=\"".
+ $str .= '<a href="tblproperties.php?'. $misc->href ."&table=". urlencode($c['f_table']) ."&schema=". urlencode($c['f_schema']) ."\"><img src=\"".
$misc->icon('ForeignKey') .'" alt="[fk]" title="'. htmlentities($c['consrc'], ENT_QUOTES, 'UTF-8') .'" /></a>';
break;
case 'u':
- $str .= '<a class="img" href="constraints.php?'. $misc->href ."&table=". urlencode($c['p_table']) ."&schema=". urlencode($c['p_schema']) ."\"><img src=\"".
+ $str .= '<a href="constraints.php?'. $misc->href ."&table=". urlencode($c['p_table']) ."&schema=". urlencode($c['p_schema']) ."\"><img src=\"".
$misc->icon('UniqueConstraint') .'" alt="[uniq]" title="'. htmlentities($c['consrc'], ENT_QUOTES, 'UTF-8') .'" /></a>';
break;
case 'c':
- $str .= '<a class="img" href="constraints.php?'. $misc->href ."&table=". urlencode($c['p_table']) ."&schema=". urlencode($c['p_schema']) ."\"><img src=\"".
+ $str .= '<a href="constraints.php?'. $misc->href ."&table=". urlencode($c['p_table']) ."&schema=". urlencode($c['p_schema']) ."\"><img src=\"".
$misc->icon('CheckConstraint') .'" alt="[check]" title="'. htmlentities($c['consrc'], ENT_QUOTES, 'UTF-8') .'" /></a>';
}
}
p {
color: #fff;
}
-p.comment, td.comment {
+p.comment, td.comment_cell {
color: #aff;
}
table {
.tabs .active {background-color: #449}
.tab .icon {display: block}
tr,td { height:100% }
-td a:not(.help):not(.img), th a { display:inline-block; height:100% } /* vertical-align:middle doesn't work for block elements, CSS sux */
+td:not(.constraint_cell) a:not(.help), th a { display:inline-block; height:100% } /* vertical-align:middle doesn't work for block elements, CSS sux */
td.crumb a, td.tab a { width:90% }
tr.data1 a, tr.data2 a { width:100% }
td.opbutton1 a, td.opbutton2 a { width:inherit }