1<?php
2/* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4/**
5 * SecurImage Library Utility functions
6 * @author     Alex Killing <alex.killing@gmx.de>
7 * @author     Michael Jansen <mjansen@databay.de>
8 * @ingroup    ServicesCaptcha
9 * @version    $Id$
10 */
11class ilSecurImageUtil
12{
13    /**
14     * @var string
15     */
16    private static $ver = '3_5_1';
17
18    /**
19     * @return string
20     */
21    public static function getDirectory()
22    {
23        return './Services/Captcha/lib/securimage_' . self::$ver;
24    }
25
26    /**
27     * @return string
28     */
29    public static function getImageScript()
30    {
31        return self::getDirectory() . '/il_securimage_show.php';
32    }
33
34    /**
35     * @return string
36     */
37    public static function getAudioScript()
38    {
39        $script = self::getDirectory() . '/securimage_play.swf';
40        $script = ilUtil::appendUrlParameterString($script, 'audio_file=' . self::getDirectory() . '/il_securimage_play.php', true);
41        $script = ilUtil::appendUrlParameterString($script, 'icon_file=' . ilUtil::getImagePath('icon_audiocaptcha-19.png'), true);
42        return $script;
43    }
44
45    /**
46     *
47     */
48    public static function includeSecurImage()
49    {
50        require_once 'Services/Captcha/lib/securimage_' . self::$ver . '/securimage.php';
51    }
52}
53