HEX
Server: Apache
System: Linux webm004.cluster121.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64
User: grainesdfo (155059)
PHP: 8.2.29
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/grainesdfo/www/wp-content/plugins/backwpup/components/storage-list.php
<?php
use BackWPup\Utils\BackWPupHelpers;
/**
 * @var array   $storages     An array of storage services. Default: [].
 * @var bool    $full_width   Optional. True to make the button full width. Default: false.
 * @var string  $prefix       Optional. The prefix for the input name. Default: "".
 * @var string  $job_id       Optional. The job ID. Default: null.
 */

# Defaults
$storages = $storages ?? [];
$prefix = $prefix ?? "";
$full_width = $full_width ?? false;
$job_id = $job_id ?? null;

$is_onboarding = get_site_option( 'backwpup_onboarding', false );
$css_class = 'flex flex-col gap-2 max-w-screen-md';
$storage_component = 'storage-item';
if( $is_onboarding ) {
	$storage_component = 'onboarding/storage-item';
	$css_class = 'flex flex-wrap gap-2 max-w-screen-md';
}
$total_active = count( array_filter( $storages, fn( $s ) => !empty( $s['active'] ) ) );
?>

<ul class="<?php echo esc_attr( $css_class ); ?>">
  <?php foreach ( $storages as $storage ) : ?>
      <li class="flex flex-row">
        <?php BackWPupHelpers::component( $storage_component, [
            'name' => $storage['name'],
            'slug' => $storage['slug'],
            'active' => $storage['active'],
            'full_width' => $full_width,
            'prefix' => $prefix,
            'label' => $storage['label'],
            'job_id' => $job_id,
            'total_active' => $total_active
        ]); ?>
      </li>
  <?php endforeach; ?>
</ul>