function devel_themer_inject_markers

cis7 devel_themer.module devel_themer_inject_markers($html, $marker)
cle7 devel_themer.module devel_themer_inject_markers($html, $marker)
elmsmedia7 devel_themer.module devel_themer_inject_markers($html, $marker)
icor7 devel_themer.module devel_themer_inject_markers($html, $marker)
meedjum_blog7 devel_themer.module devel_themer_inject_markers($html, $marker)
mooc7 devel_themer.module devel_themer_inject_markers($html, $marker)

Injects markers into the html returned by theme functions/templates.

Uses simplehtmldom to add a thmr attribute to toplevel html elements. A toplevel text element will be wrapped in a span.

Parameters

string $html:

string $marker:

1 call to devel_themer_inject_markers()
devel_themer_catch_function in sites/all/modules/ulmus/devel_themer/devel_themer.module
Intercepts all theme calls (including templates), adds to template log, and dispatches to original theme function.

File

sites/all/modules/ulmus/devel_themer/devel_themer.module, line 183

Code

function devel_themer_inject_markers($html, $marker) {
  if (!module_exists('simplehtmldom')) {
    drupal_set_message(t('<a href="http://drupal.org/project/simplehtmldom">Simplehtmldom</a> module is missing and required by Theme developer.'), 'error', FALSE);
    return $html;
  }

  $html_dom = new simple_html_dom();
  $html_dom->load($html);
  foreach ($html_dom->root->nodes as $element) {
    if ($element->nodetype == HDOM_TYPE_TEXT) {
      if (trim($element->innertext) !== '') {
        $element->innertext = "<span " . DEVEL_THEMER_ATTRIBUTE . "='$marker' class='devel-themer-wrapper'>{$element->innertext}</span>";
      }
    }
    elseif ($element->hasAttribute(DEVEL_THEMER_ATTRIBUTE)) {
      $element->setAttribute(DEVEL_THEMER_ATTRIBUTE, "$marker " . $element->getAttribute(DEVEL_THEMER_ATTRIBUTE));
    }
    else {
      $element->setAttribute(DEVEL_THEMER_ATTRIBUTE, $marker);
    }
  }
  $html = (string) $html_dom;
  // Release memory.
  $html_dom->clear();
  unset($html_dom);
  return $html;
}
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.