Skip to content

Commit

Permalink
Little cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastien Giroux committed Aug 21, 2011
1 parent 9b73d1d commit 9183399
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 8 deletions.
2 changes: 2 additions & 0 deletions describe_columnfamily.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@

$vw_vars['is_counter_column'] = $vw_cf_vars['default_validation_class'] == 'org.apache.cassandra.db.marshal.CounterColumnType';

$vw_vars['is_read_only_keyspace'] = isReadOnlyKeyspace($keyspace_name);

echo getHTML('describe_columnfamily.php',$vw_vars);
}
else {
Expand Down
2 changes: 1 addition & 1 deletion describe_keyspace.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
$vw_vars['ring'] = array();
$vw_vars['list_column_families'] = '';

$vw_vars['is_readonly_keyspace'] = isReadyOnlyKeyspace($keyspace_name);
$vw_vars['is_read_only_keyspace'] = isReadOnlyKeyspace($keyspace_name);

$nb_cfs = count($describe_keyspace->cf_defs);
if ($nb_cfs == 0) {
Expand Down
2 changes: 1 addition & 1 deletion include/kernel.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ function getPageTitle() {
Return true if a keyspace is read-only, false otherwise
*/

function isReadyOnlyKeyspace($keyspace_name) {
function isReadOnlyKeyspace($keyspace_name) {
return in_array($keyspace_name,explode(',',READ_ONLY_KEYSPACES));
}

Expand Down
2 changes: 1 addition & 1 deletion views/columnfamily_details.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php if ($show_edit_link): ?>
<h4>
<a href="describe_columnfamily.php?keyspace_name=<?php echo $keyspace_name; ?>&amp;columnfamily_name=<?php echo $columnfamily_name; ?>"><?php echo $columnfamily_name; ?></a>
<?php if (!isReadyOnlyKeyspace($keyspace_name)): ?>- <a href="columnfamily_action.php?action=edit&amp;keyspace_name=<?php echo $keyspace_name; ?>&amp;columnfamily_name=<?php echo $columnfamily_name; ?>">Edit</a><?php endif; ?>
<?php if (!$is_read_only_keyspace): ?>- <a href="columnfamily_action.php?action=edit&amp;keyspace_name=<?php echo $keyspace_name; ?>&amp;columnfamily_name=<?php echo $columnfamily_name; ?>">Edit</a><?php endif; ?>
</h4>
<?php endif; ?>

Expand Down
8 changes: 4 additions & 4 deletions views/describe_columnfamily.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div class="icon browse_data"></div> Browse Data
</div>

<?php if (!isReadyOnlyKeyspace($keyspace_name)): ?>
<?php if (!$is_read_only_keyspace): ?>
<div class="menu_item" onclick="location.href='columnfamily_action.php?action=create_secondary_index&amp;keyspace_name=<?php echo $keyspace_name; ?>&amp;columnfamily_name=<?php echo $columnfamily_name; ?>'">
<div class="icon create_secondary_index"></div> Create Secondary Index
</div>
Expand All @@ -15,19 +15,19 @@
<div class="icon get_key"></div> Get Key
</div>

<?php if (!isReadyOnlyKeyspace($keyspace_name) && $is_counter_column): ?>
<?php if (!$is_read_only_keyspace && $is_counter_column): ?>
<div class="menu_item" onclick="location.href='counters.php?keyspace_name=<?php echo $keyspace_name; ?>&amp;columnfamily_name=<?php echo $columnfamily_name; ?>'">
<div class="icon counters"></div> Counters
</div>
<?php endif; ?>

<?php if (!isReadyOnlyKeyspace($keyspace_name) && !$is_counter_column): ?>
<?php if (!$is_read_only_keyspace && !$is_counter_column): ?>
<div class="menu_item" onclick="location.href='columnfamily_action.php?action=insert_row&amp;keyspace_name=<?php echo $keyspace_name; ?>&amp;columnfamily_name=<?php echo $columnfamily_name; ?>'">
<div class="icon insert_row"></div> Insert Row
</div>
<?php endif; ?>

<?php if (!isReadyOnlyKeyspace($keyspace_name)): ?>
<?php if (!$is_read_only_keyspace): ?>
<div class="menu_item" onclick="location.href='columnfamily_action.php?action=edit&amp;keyspace_name=<?php echo $keyspace_name; ?>&amp;columnfamily_name=<?php echo $columnfamily_name; ?>'">
<div class="icon edit_column_family"></div> Edit Column Family
</div>
Expand Down
2 changes: 1 addition & 1 deletion views/describe_keyspace.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<h3><a href="index.php"><?php echo $cluster_name; ?></a> &gt; <?php echo $keyspace_name; ?></h3>

<?php if (!isReadyOnlyKeyspace($keyspace_name)): ?>
<?php if (!$is_read_only_keyspace): ?>
<div id="menu">
<div class="menu_item" style="width: 220px;" onclick="location.href='keyspace_action.php?action=create_cf&amp;keyspace_name=<?php echo $keyspace_name; ?>'">
<div class="icon create_column_family"></div> Create New Column Family
Expand Down

0 comments on commit 9183399

Please sign in to comment.