hooks.php
author Dan
Sun, 14 Dec 2008 00:35:52 -0500
changeset 34 a8daa2016cf1
parent 8 0acb8d9a3194
permissions -rw-r--r--
Added support for last month and last 2 weeks graphs; adjusted web interface accordingly

<?php

global $eb_hooks;
$eb_hooks = array();

function eb_hook($hook_name, $code)
{
  global $eb_hooks;
  if ( !isset($eb_hooks[$hook_name]) )
    $eb_hooks[$hook_name] = array();
  
  $eb_hooks[$hook_name][] = $code;
}

function eb_fetch_hook($hook_name)
{
  global $eb_hooks;
  return ( isset($eb_hooks[$hook_name]) ) ? implode("\n", $eb_hooks[$hook_name]) : 'eb_void();';
}

// null function for filling empty hooks
function eb_void()
{
}