aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/grum_plugins_classes-2/genericjs.class.inc.php
blob: d5038c0d97a598952ca2d6f01238f8d98cbc7ad7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php

/* -----------------------------------------------------------------------------
  class name: genericjs
  class version: 2.0
  date: 2008-07-20
  ------------------------------------------------------------------------------
  author: grum at grum.dnsalias.com
  << May the Little SpaceFrog be with you >>
  ------------------------------------------------------------------------------

   this classes provides base functions to add genericjs.js file into html page

   > see genericjs.js file to know javascript functions added 

    - constructor genericjs()
   ---------------------------------------------------------------------- */


class genericjs
{
  function genericjs()
  {
    add_event_handler('loc_end_page_header', array(&$this, 'load_JS'));
  }

  function load_JS()
  {
    global $template;

    $name='plugins/'.basename(dirname(__FILE__)).'/genericjs.js';

    $template->append('head_elements', '<script src="'.$name.'" type="text/javascript"></script>');

  }

} //class

$genericjs=new genericjs();

?>