• Main Page
  • Related Pages
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

modules/dateplaner/classes/class.Gui.php

Go to the documentation of this file.
00001 <?php
00002 /*
00003         +-----------------------------------------------------------------------------+
00004         | ILIAS open source                                                                                                                       |
00005         |       Dateplaner Modul                                                                                                                  |                                                                                                     
00006         +-----------------------------------------------------------------------------+
00007         | Copyright (c) 2004 ILIAS open source & University of Applied Sciences Bremen|
00008         |                                                                             |
00009         | This program is free software; you can redistribute it and/or               |
00010         | modify it under the terms of the GNU General Public License                 |
00011         | as published by the Free Software Foundation; either version 2              |
00012         | of the License, or (at your option) any later version.                      |
00013         |                                                                             |
00014         | This program is distributed in the hope that it will be useful,             |
00015         | but WITHOUT ANY WARRANTY; without even the implied warranty of              |
00016         | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               |
00017         | GNU General Public License for more details.                                |
00018         |                                                                             |
00019         | You should have received a copy of the GNU General Public License           |
00020         | along with this program; if not, write to the Free Software                 |
00021         | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. |
00022         +-----------------------------------------------------------------------------+
00023 */
00024 
00039 include('.'.DATEPLANER_ROOT_DIR.'/config/conf.gui.php');
00040 
00041 class Gui
00042 {
00043 
00048         function Gui() {
00049         }
00050 
00060         function getTemplate($template, $extension="htm") {
00061         global $templatefolder, $actualtemplate;
00062 
00063         if(!$templatefolder) $templatefolder = "templates";
00064         return str_replace("\"","\\\"",implode("",file(".".DATEPLANER_ROOT_DIR.$templatefolder."/".$actualtemplate."/".$template.".".$extension)));
00065         }
00066 
00074         function getLangArray($DP_Lang) {
00075                 $array_tmp = file('.'.DATEPLANER_ROOT_DIR.'/lang/dp_'.$DP_Lang.'.lang');
00076                 foreach($array_tmp as $v)
00077                 {
00078                         if ((substr(trim($v),0,13)=='dateplaner#:#') && (substr_count($v,'#:#')>=2))
00079                         {//Line mustn't start with a ';' and must contain at least one '=' symbol.
00080                                 $pos            = strpos($v, '#:#', '13');
00081                                 $offset1        = strpos($v, '#:#', '13')-13;
00082                                 $offset2        = strpos($v, '###', '13')-$offset1-16;
00083                                 if($offset2 != (-$offset1-16)) {
00084                                         $DP_language[trim(substr($v,13,$offset1))] = trim(substr($v, $pos+3,$offset2));
00085                                 }
00086                                 else {
00087                                         $DP_language[trim(substr($v,13,$offset1))] = trim(substr($v, $pos+3));
00088                                 }
00089                         }
00090                 }
00091                 unset($array_tmp);
00092 
00093                 return $DP_language;
00094         }
00095 
00106         function setToolTip($starttime, $endtime, $shortext, $text, $id ) {
00107                 $text = str_replace("\r\n","<br>" , $text);
00108                 $headerText = $starttime.' -  '.$endtime.' ['.$shortext.']';
00109                 $float= "<div id='$id' style='position:absolute; top:400px; left:0px; width:250; visibility:hidden; z-index:1; background-color:white'>";
00110                 $float.= '
00111 <table border="0" cellpadding="2" cellspacing="2" style="border-collapse: collapse"  width="100%" height="100%">
00112   <tr>
00113     <td width="100%" bgcolor="#000080"><b><font color="#FFFFFF">'.$headerText.'</font></b> </td>
00114   </tr>
00115   <tr>
00116     <td width="100%" height="100%" valign="top" bgcolor="#FFFFFF" ><font color="#000000">'.$text.'</font></td>
00117   </tr>
00118 </table>
00119                                                 </div>';
00120                 Return $float;
00121 
00122         }
00123 
00124 
00125 } // end class
00126 ?>

Generated on Fri Dec 13 2013 09:06:37 for ILIAS Release_3_4_x_branch .rev 46804 by  doxygen 1.7.1