[svn r12065] New script for hotspots which parse lang files

skala
Julian Prud'homme 18 years ago
parent 041a199e0d
commit 1c7ae1016b
  1. 85
      main/exercice/hotspot.inc.php

@ -1,17 +1,68 @@
&select=Select
&square=Rectangle
&circle=Ellipse
&poly=Polygon
&status1=Draw a hotspot.
&status2_poly=Use right-click to close the polygon.
&status2_other=Release the mousebutton to save the hotspot.
&status3=Hotspot saved.
&exercise_status_1=Status: Question not yet terminated
&exercise_status_2=Click to submit your answers to the question
&exercise_status_3=Status: Question terminated
&showUserPoints=Show/Hide userclicks
&showHotspots=Show/Hide hotspots
&labelPolyMenu=Close polygon
&triesleft=Tries left
&exeFinished=All answers defined: rearrange spots or click to submit
&nextAnswer=Now click on: &done=done
<?php
/*
DOKEOS - elearning and course management software
For a full list of contributors, see documentation/credits.html
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
See "documentation/licence.html" more details.
Contact:
Dokeos
Rue des Palais 44 Paleizenstraat
B-1030 Brussels - Belgium
Tel. +32 (2) 211 34 56
*/
/**
* Hotspot languae conversion
* @package dokeos.exercise
* @author
* @version $Id: admin.php 10680 2007-01-11 21:26:23Z pcool $
*/
include_once('../inc/global.inc.php');
$hotspot_lang_file = api_get_path(SYS_LANG_PATH);
$search = array('../','\\0');
if(file_exists($hotspot_lang_file . $language_interface . '/hotspot.inc.php'))
$hotspot_lang_file .= $language_interface . '/hotspot.inc.php';
else
$hotspot_lang_file .= 'english/hotspot.inc.php';
$file = file($hotspot_lang_file);
$temp = array();
foreach($file as $value)
{
$explode = explode('=', $value , 2);
if(count($explode) > 1)
{
$explode[0] = trim($explode[0]);
$explode[0] = '&' . substr($explode[0], 1, strlen($explode[0]));
$explode[1] = trim($explode[1]);
$explode[1] = substr($explode[1], 0, strlen($explode[1]) - 1);
$explode[1] = ereg_replace('"', '', $explode[1]);
$string_temp = substr($explode[1],1);
$temp[] = $explode[0] . '=' . substr($string_temp, 0, strlen($string_temp)-1);
}
}
foreach($temp as $value)
{
echo utf8_decode($value . ' ');
}
?>
Loading…
Cancel
Save