diff options
author | Jehan-Guillaume de Rorthais | 2013-11-17 23:31:53 +0000 |
---|---|---|
committer | Jehan-Guillaume de Rorthais | 2013-11-17 23:31:53 +0000 |
commit | 4680728829d8f95e29514512c9e94bb5345aa58a (patch) | |
tree | 95d326ff3f54aa80b1841dd6eb917515c6883fd7 | |
parent | f827234fa969a5ebec8ada9969346c51cf2ee499 (diff) |
Use cleaner class names for comments cells and constaints icons
-rw-r--r-- | classes/Misc.php | 11 | ||||
-rw-r--r-- | tblproperties.php | 11 | ||||
-rw-r--r-- | themes/gotar/global.css | 4 |
3 files changed, 15 insertions, 11 deletions
diff --git a/classes/Misc.php b/classes/Misc.php index 7db0ae61..7b81f840 100644 --- a/classes/Misc.php +++ b/classes/Misc.php @@ -1843,6 +1843,7 @@ * $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, * ), ... @@ -1924,7 +1925,7 @@ 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 @@ -1955,6 +1956,8 @@ 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(); @@ -1964,7 +1967,7 @@ 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"; @@ -1972,7 +1975,7 @@ } break; case 'comment': - echo "<td class='comment'>"; + echo "<td class='comment_cell'>"; $val = value($column['field'], $tabledata->fields); if (!is_null($val)) { echo $val; @@ -1980,7 +1983,7 @@ echo "</td>"; break; default: - echo "<td>"; + echo "<td{$class}>"; $val = value($column['field'], $tabledata->fields); if (!is_null($val)) { if (isset($column['url'])) { diff --git a/tblproperties.php b/tblproperties.php index a68bf618..f73ce8b6 100644 --- a/tblproperties.php +++ b/tblproperties.php @@ -491,6 +491,7 @@ ), 'keyprop' => array( 'title' => $lang['strconstraints'], + 'class' => 'constraint_cell', 'field' => field('attname'), 'type' => 'callback', 'params'=> array( @@ -503,7 +504,7 @@ ), 'comment' => array( 'title' => $lang['strcomment'], - 'field' => field('comment'), + 'field' => field('comment') ), ); @@ -521,19 +522,19 @@ 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>'; } } diff --git a/themes/gotar/global.css b/themes/gotar/global.css index 9de7a77f..3de88657 100644 --- a/themes/gotar/global.css +++ b/themes/gotar/global.css @@ -16,7 +16,7 @@ body { p { color: #fff; } -p.comment, td.comment { +p.comment, td.comment_cell { color: #aff; } table { @@ -166,7 +166,7 @@ table.tabs { .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 } |