ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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_2_4";
13 // private static $ver = "3_1_0";
14
15 private static $ui_ver = "1_12_0";
16 private static $maphilight_ver = "14_03_20";
17 private static $min = "-min";
18
22 static function initjQuery($a_tpl = null)
23 {
24 global $tpl;
25
26 /*
27 self::$ver = DEVMODE
28 ? "3_1_0"
29 : "2_2_4";
30 */
31 self::$min = DEVMODE
32 ? ""
33 : "-min";
34
35 if ($a_tpl == null)
36 {
37 $a_tpl = $tpl;
38 }
39
40 $a_tpl->addJavaScript(self::getLocaljQueryPath(), true, 1);
41
42 /*
43 // adding jquery-migrate for >= 1.9.x
44 $major = explode("_", self::$ver);
45 $major = $major[0]*100+$major[1];
46 if($major >= 109)
47 {
48 $path = str_replace("jquery", "jquery-migrate", self::getLocaljQueryPath());
49 $a_tpl->addJavaScript($path, true, 1);
50 }
51 */
52 }
53
57 static function initjQueryUI()
58 {
59 global $tpl;
60
61 $tpl->addJavaScript(self::getLocaljQueryUIPath(), true, 1);
62 }
63
67 static function getLocaljQueryPath()
68 {
69 return "./Services/jQuery/js/".self::$ver."/jquery".self::$min.".js";
70 }
71
75 static function getLocaljQueryUIPath()
76 {
77 return "./Services/jQuery/js/ui_".self::$ui_ver."/jquery-ui".self::$min.".js";
78 }
79
80 //
81 // Maphilight plugin
82 //
83
87 static function initMaphilight()
88 {
89 global $tpl;
90
91 $tpl->addJavaScript(self::getLocalMaphilightPath(), true, 1);
92 }
93
97 static function getLocalMaphilightPath()
98 {
99 return "./Services/jQuery/js/maphilight_".self::$maphilight_ver."/maphilight.js";
100 }
101
102}
103?>
global $tpl
Definition: ilias.php:8
An exception for terminatinating execution or to throw for unit testing.
jQuery utilities
static initjQueryUI()
Init jQuery UI (see included_components.txt for included components)
static getLocaljQueryUIPath()
Get local path of jQuery UI file.
static getLocaljQueryPath()
Get local path of jQuery file.
static initMaphilight()
Init maphilight.
static getLocalMaphilightPath()
Get local path of maphilight file.
static initjQuery($a_tpl=null)
Init jQuery.