You are here

function flash_nodeapi in Flash Node 5

Implementation of hook_nodeapi().

File

./flash.module, line 119

Code

function flash_nodeapi(&$node, $op, $arg) {
  switch ($op) {
    case 'view':
      static $ufo_added = FALSE;

      /**
       * at the moment we add ufo.js to all pages
       * think this could be amended using a reg_ex to examine the node to see
       * if the js is required. To do later!
       */
      if (!$ufo_added) {

        // insert ufo.js in to the page header
        $flash_script = drupal_get_path('module', 'flash') . '/ufo.js';
        drupal_add_js($flash_script);
        $ufo_added = TRUE;
      }
  }
}