function _entity_iframe_view_iframe

cis7 entity_iframe.module _entity_iframe_view_iframe($type, $etid)
cle7 entity_iframe.module _entity_iframe_view_iframe($type, $etid)
elmsmedia7 entity_iframe.module _entity_iframe_view_iframe($type, $etid)
icor7 entity_iframe.module _entity_iframe_view_iframe($type, $etid)
meedjum_blog7 entity_iframe.module _entity_iframe_view_iframe($type, $etid)
mooc7 entity_iframe.module _entity_iframe_view_iframe($type, $etid)

Helper function to return if a link show be displayed.

4 calls to _entity_iframe_view_iframe()
cis_shortcodes_entity_view in sites/all/modules/elmsln_contrib/cis_connector/modules/cis_shortcodes/cis_shortcodes.module
Implements hook_entity_view().
entity_iframe_entity_view in sites/all/modules/elmsln_contrib/entity_iframe/entity_iframe.module
Implements hook_entity_view().
views_handler_field_entity_iframe_embed::render in sites/all/modules/elmsln_contrib/entity_iframe/views/views_handler_field_entity_iframe_embed.inc
Render the field.
views_handler_field_entity_iframe_link::render_link in sites/all/modules/elmsln_contrib/entity_iframe/views/views_handler_field_entity_iframe_link.inc
Renders the link if they have permission to view it
1 string reference to '_entity_iframe_view_iframe'
entity_iframe_menu in sites/all/modules/elmsln_contrib/entity_iframe/entity_iframe.module
Implements hook_menu().

File

sites/all/modules/elmsln_contrib/entity_iframe/entity_iframe.module, line 252
Provide an iframe display definition for common entity types.

Code

function _entity_iframe_view_iframe($type, $etid) {
  // ensure it is enabled and they can get to it
  if (user_access('access iframe version')) {
    // build types for the fallback
    $types = _entity_iframe_entity_types();
    $entity_info = entity_get_info();
    // return allowed
    $allowed_types = variable_get('entity_iframe_types', $types);
    // shortcut, if type blocked then don't bother with additional processing
    if (array_key_exists($type, $allowed_types) && $allowed_types[$type]) {
      // check that this id's bundle is allowed
      $bundles = _entity_iframe_entity_bundles($type);
      // load current bundles
      $allowed_bundles = variable_get('entity_iframe_bundle_' . $type, $bundles);
      // fully load entity, entity_cache is recommended when using this module
      $entity = entity_load_single($type, $etid);
      // need to test for bundle key definition
      if (!empty($entity_info[$type]['entity keys']['bundle'])) {
        $bundle = $entity->{$entity_info[$type]['entity keys']['bundle']};
      }
      else {
        // fallback case for entities that are 1 to 1 in bundle connotation
        $bundle = $type;
      }
      // evaluation for bundle being allowed
      $bundle_allowed = (array_key_exists($bundle, $allowed_bundles) && $allowed_bundles[$bundle]);
      // type and bundle must be allowed to pass check
      return $bundle_allowed;
    }
  }
  return FALSE;
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.