You are here

function uuid_fpp_features_export_options in UUID Features Integration 7

Implements hook_features_export_options().

File

includes/uuid_fpp.features.inc, line 11
Features hooks for the uuid_fpp features component.

Code

function uuid_fpp_features_export_options() {
  $options = array();
  $query = db_select('fieldable_panels_panes', 'f')
    ->fields('f', array(
    'fpid',
    'admin_title',
    'title',
    'bundle',
    'uuid',
  ))
    ->orderBy('f.bundle', 'ASC')
    ->orderBy('f.title', 'ASC')
    ->addTag('uuid_fpp_features_export_options');
  $results = $query
    ->execute()
    ->fetchAll();
  foreach ($results as $fpp) {
    $bundle_name = ucwords(str_replace('_', ' ', $fpp->bundle));
    $display_title = $fpp->admin_title ? $fpp->admin_title : $fpp->uuid;
    $options[$fpp->uuid] = $bundle_name . ' - ' . $display_title;
  }
  return $options;
}