Use cleaner class names for comments cells and constaints icons
authorJehan-Guillaume de Rorthais <ioguix@free.fr>
Sun, 17 Nov 2013 23:31:53 +0000 (00:31 +0100)
committerJehan-Guillaume de Rorthais <ioguix@free.fr>
Sun, 17 Nov 2013 23:31:53 +0000 (00:31 +0100)
classes/Misc.php
tblproperties.php
themes/gotar/global.css

index 7db0ae6194b235af2d27779ad594bb3b6c35720b..7b81f84094f8a5c6db28a9c2cf5244382a4a9949 100644 (file)
                 *                      $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'])) {
index a68bf6185465c5c6405ac0e49e5c7517d8e198a1..f73ce8b6c569d1eb6dd7966b7c8a509a9f176673 100644 (file)
                        ),
                        '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 ."&amp;table=". urlencode($c['p_table']) ."&amp;schema=". urlencode($c['p_schema']) ."\"><img src=\"".
+                                                       $str .= '<a href="constraints.php?'. $misc->href ."&amp;table=". urlencode($c['p_table']) ."&amp;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 ."&amp;table=". urlencode($c['f_table']) ."&amp;schema=". urlencode($c['f_schema']) ."\"><img src=\"".
+                                                       $str .= '<a href="tblproperties.php?'. $misc->href ."&amp;table=". urlencode($c['f_table']) ."&amp;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 ."&amp;table=". urlencode($c['p_table']) ."&amp;schema=". urlencode($c['p_schema']) ."\"><img src=\"".
+                                                       $str .= '<a href="constraints.php?'. $misc->href ."&amp;table=". urlencode($c['p_table']) ."&amp;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 ."&amp;table=". urlencode($c['p_table']) ."&amp;schema=". urlencode($c['p_schema']) ."\"><img src=\"".
+                                                       $str .= '<a href="constraints.php?'. $misc->href ."&amp;table=". urlencode($c['p_table']) ."&amp;schema=". urlencode($c['p_schema']) ."\"><img src=\"".
                                                                $misc->icon('CheckConstraint') .'" alt="[check]" title="'. htmlentities($c['consrc'], ENT_QUOTES, 'UTF-8') .'" /></a>';
                                        }
                        }
index 9de7a77f831fbaf489f1738e470744ce9015875e..3de8865795cd3295b39e775351073ab797b4e780 100644 (file)
@@ -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 }