You are here

function _tracking_code_all_by_region in Tracking Code 7

Process all tracking code snippets into an array.

Return value

array an array of all tracking code objects, organized by region

1 call to _tracking_code_all_by_region()
tracking_code_overview_form in ./tracking_code.admin.inc
Form for tracking code overview table.

File

./tracking_code.module, line 273
main module file for tracking_code module

Code

function _tracking_code_all_by_region() {
  $snippets = array(
    'header' => array(),
    'page_top' => array(),
    'page_bottom' => array(),
  );
  $results = db_select('tracking_code', 't')
    ->fields('t')
    ->execute();
  foreach ($results as $snippet) {
    $snippets[$snippet->region][$snippet->tcid] = $snippet;
  }
  return $snippets;
}