Skip to content

Commit

Permalink
chore: small improvements for Elgg stats listing
Browse files Browse the repository at this point in the history
  • Loading branch information
jeabakker committed Jun 20, 2022
1 parent 9245ecd commit 00e50ee
Showing 1 changed file with 10 additions and 16 deletions.
26 changes: 10 additions & 16 deletions views/default/opensearch/stats/elgg.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,49 +7,43 @@
// sync enabled
$sync_enabled = elgg_get_plugin_setting('sync', 'opensearch');
$content .= '<tr>';
$content .= '<td>' . elgg_echo('opensearch:settings:sync') . '</td>';
$content .= '<td>' . elgg_echo("option:{$sync_enabled}") . '</td>';
$content .= elgg_format_element('td', [], elgg_echo('opensearch:settings:sync'));
$content .= elgg_format_element('td', [], elgg_echo("option:{$sync_enabled}"));
$content .= '</tr>';

// content to index
// total content to index
$options = opensearch_get_bulk_options('count');
$count = elgg_get_entities($options);

$content .= '<tr>';
$content .= '<td>' . elgg_echo('opensearch:stats:elgg:total');
$content .= elgg_view('output/longtext', [
'value' => elgg_echo('opensearch:stats:elgg:total:help'),
'class' => 'elgg-subtext',
]) . '</td>';
$content .= "<td>{$count}</td>";
$content .= elgg_format_element('td', [], elgg_get_entities($options));
$content .= '</tr>';

// content to index
// new content to index
$options = opensearch_get_bulk_options();
$options['count'] = true;
$count = elgg_get_entities($options);

$content .= '<tr>';
$content .= '<td>' . elgg_echo('opensearch:stats:elgg:no_index_ts') . '</td>';
$content .= "<td>{$count}</td>";
$content .= elgg_format_element('td', [], elgg_echo('opensearch:stats:elgg:no_index_ts'));
$content .= elgg_format_element('td', [], elgg_count_entities($options));
$content .= '</tr>';

// content to update
$options = opensearch_get_bulk_options('update');
$options['count'] = true;
$count = elgg_get_entities($options);

$content .= '<tr>';
$content .= '<td>' . elgg_echo('opensearch:stats:elgg:update') . '</td>';
$content .= "<td>{$count}</td>";
$content .= elgg_format_element('td', [], elgg_echo('opensearch:stats:elgg:update'));
$content .= elgg_format_element('td', [], elgg_count_entities($options));
$content .= '</tr>';

// content to reindex
$options = opensearch_get_bulk_options('reindex');
$count = 0;
if (!empty($options)) {
$options['count'] = true;
$count = elgg_get_entities($options);
$count = elgg_count_entities($options);
}

$content .= '<tr>';
Expand Down

0 comments on commit 00e50ee

Please sign in to comment.