You are here

function minisite_site_paths_info in Mini site 7

Return minisite paths information.

1 call to minisite_site_paths_info()
minisite_site_parse in includes/minisite.site.inc
Parse minisite.

File

includes/minisite.site.inc, line 227
minisite.site.inc

Code

function minisite_site_paths_info($minisite_info) {
  $minisite_site_request = '';
  $minisite_site_url = '';
  $minisite_entity_alias = '';

  // Load module inc file.
  module_load_include('inc', 'minisite', 'includes/minisite.func');

  // Get entity object.
  $entity = _minisite_site_load_entity($minisite_info['entity_type'], [
    $minisite_info['entity_id'],
  ]);
  if ($entity) {
    $minisite_base_url = _minisite_site_file_public_path_base_url();
    $minisite_site_request = $minisite_base_url . $minisite_info['source'];

    // Get minisite base href url.
    $minisite_field_values = minisite_asset_field_values($minisite_info['entity_type'], $entity, $minisite_info['minisite_field_name']);
    $minisite_site_path = $minisite_field_values['site_path'];
    $minisite_site_url = $minisite_base_url . $minisite_site_path . '/';

    // Get entity alias path.
    $minisite_entity_alias = _minisite_site_load_alias($minisite_info['entity_type'], $entity);
  }
  return [
    $minisite_site_request,
    $minisite_site_url,
    $minisite_entity_alias,
  ];
}