ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.iljQueryUtil.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
3
11{
12 private static $ver = "2_1_4";
13 private static $ui_ver = "1_11_4";
14 private static $maphilight_ver = "14_03_20";
15 private static $min = "-min";
16
20 static function initjQuery($a_tpl = null)
21 {
22 global $tpl;
23
24 if ($a_tpl == null)
25 {
26 $a_tpl = $tpl;
27 }
28
29 $a_tpl->addJavaScript(self::getLocaljQueryPath(), true, 1);
30
31 // adding jquery-migrate for >= 1.9.x
32 $major = explode("_", self::$ver);
33 $major = $major[0]*100+$major[1];
34 if($major >= 109)
35 {
36 $path = str_replace("jquery", "jquery-migrate", self::getLocaljQueryPath());
37
38 // this will enable console error logging!
39 if(DEVMODE)
40 {
41 $path = str_replace(self::$min, "", $path);
42 }
43
44 $a_tpl->addJavaScript($path, true, 1);
45 }
46 }
47
51 static function initjQueryUI()
52 {
53 global $tpl;
54
55 $tpl->addJavaScript(self::getLocaljQueryUIPath(), true, 1);
56 }
57
62 {
63 return "./Services/jQuery/js/".self::$ver."/jquery".self::$min.".js";
64 }
65
70 {
71 return "./Services/jQuery/js/ui_".self::$ui_ver."/jquery-ui.min.js";
72 }
73
74 //
75 // Maphilight plugin
76 //
77
81 static function initMaphilight()
82 {
83 global $tpl;
84
85 $tpl->addJavaScript(self::getLocalMaphilightPath(), true, 1);
86 }
87
92 {
93 return "./Services/jQuery/js/maphilight_".self::$maphilight_ver."/maphilight.js";
94 }
95
96}
97?>
global $tpl
Definition: ilias.php:8
jQuery utilities
static initjQueryUI()
Init jQuery UI (see included_components.txt for included components)
getLocalMaphilightPath()
Get local path of maphilight file.
static initMaphilight()
Init maphilight.
getLocaljQueryPath()
Get local path of jQuery file.
getLocaljQueryUIPath()
Get local path of jQuery UI file.
static initjQuery($a_tpl=null)
Init jQuery.
$path
Definition: index.php:22