Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Composite value display #22

Merged
merged 1 commit into from Oct 26, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion css/style.css
Expand Up @@ -227,4 +227,7 @@ a, a:visited {

#columnfamily_details {
max-width: 400px;
}
}

.composite_value {font-size:14px;}
.composite_value b {color:blue;}
6 changes: 6 additions & 0 deletions helper/ColumnFamilyHelper.php
Expand Up @@ -116,6 +116,12 @@ public static function displaySCFRow($row_key,$keyspace_name,$columnfamily_name,
return $output;
}

/*
Used by usort() method. Assists in sorts column families by name

@param $a cassandra\CFDef Object
@param $b cassandra\CFDef Object
*/
public static function sortCfDefsCallable($a, $b) {
return strcmp($a->name, $b->name);
}
Expand Down
15 changes: 14 additions & 1 deletion views/columnfamily_row.php
Expand Up @@ -17,7 +17,20 @@
<?php foreach ($row as $column => $value): ?>
<tr>
<td><?php echo htmlentities($column,ENT_COMPAT,'UTF-8'); ?></td>
<td><pre><?php echo htmlentities($value,ENT_COMPAT,'UTF-8'); ?></pre></td>
<td><pre><?php
if (is_array($value)) { // not sure of a better way to determine if composite or not

foreach ($value as &$valItem) {
$valItem = htmlentities($valItem,ENT_COMPAT,'UTF-8');
}

echo '<div class="composite_value" title="CompositeType"><b>CompositeType [</b> <i>'.
implode('</i> <b>,</b> <i>', $value).
'</i> <b>]</b></div>';
} else {
echo htmlentities($value,ENT_COMPAT,'UTF-8');
}
?></pre></td>
</tr>
<?php endforeach; ?>
</table>