Skip to content

Commit

Permalink
Partial revert LIst Table
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandergull committed Dec 15, 2023
1 parent 23db725 commit 424052f
Showing 1 changed file with 6 additions and 19 deletions.
25 changes: 6 additions & 19 deletions lib/CleantalkSP/SpbctWP/ListTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ public function display()

<tbody>
<?php
$this->displayRows($this->id); ?>
$this->displayRows(); ?>
</tbody>

<tfoot>
Expand Down Expand Up @@ -303,7 +303,7 @@ public function getTemplate()

<tbody>
<?php
$this->displayRows($this->id); ?>
$this->displayRows(); ?>
</tbody>

<tfoot>
Expand Down Expand Up @@ -417,24 +417,19 @@ public function displayColumnHeaders()
unset($column_key);
}

public function displayRows($id, $return = false)
public function displayRows($return = false)
{
$out = '';
$blocks_count = 0;

foreach ( $this->items as $item ) {
$item = (array)$item;

$out .= '<tr>';
$scheduled = !empty($item['uid']) && in_array($item['uid'], spbc_get_list_of_scheduled_critical_files_to_send());
$gray_start = $scheduled ? '<span style="color: darkgray">' : '';
$gray_end = $scheduled ? '</span>' : '';
$blocks_count += 1;
$rows_count = 0;
$hide_show_mob_class_name = '';
$first_row_class_name = '';

foreach ( $this->columns as $column_key => $column ) {
$rows_count += 1;
$classes = "$column_key column-$column_key";
$classes .= isset($column['primary']) ? ' column-primary' : '';
$classes .= isset($column['class']) ? ' ' . $column['class'] : '';
Expand All @@ -450,19 +445,11 @@ public function displayRows($id, $return = false)
$classes
);
} else {
$class_key = "'" . $id . '_block_' . "'";
if ($column_key != "ip_entry" && $column_key != 'user_login') {
$hide_show_mob_class_name = $id . '_block_' . $blocks_count;
$first_row_class_name = 'mob_entries';
}
$out .= "<td class='$classes $first_row_class_name $hide_show_mob_class_name'>";
$out .= "<td class='$classes'>";

$out .= "<div class='spbcShortTextBlock'>";
$out .= isset($item[$column_key]) ? $gray_start . $item[$column_key] . $gray_end : '-';
$out .= "</div>";

$out .= isset($column['primary'])
? '<button type="button" onclick="show_hide_rows(' . $blocks_count . ',' . $class_key . ')" class="toggle-row"><span class="screen-reader-text">' . __(
? '<button type="button" class="toggle-row"><span class="screen-reader-text">' . __(
'Show more details'
) . '</span></button>'
: '';
Expand Down

0 comments on commit 424052f

Please sign in to comment.