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

Modules/Scorm2004/classes/buildRTE.php

Go to the documentation of this file.
00001 <?php
00002 /*
00003         +-----------------------------------------------------------------------------+
00004         | ILIAS open source                                                           |
00005         +-----------------------------------------------------------------------------+
00006         | Copyright (c) 1998-2007 ILIAS open source, University of Cologne            |
00007         |                                                                             |
00008         | This program is free software; you can redistribute it and/or               |
00009         | modify it under the terms of the GNU General Public License                 |
00010         | as published by the Free Software Foundation; either version 2              |
00011         | of the License, or (at your option) any later version.                      |
00012         |                                                                             |
00013         | This program is distributed in the hope that it will be useful,             |
00014         | but WITHOUT ANY WARRANTY; without even the implied warranty of              |
00015         | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               |
00016         | GNU General Public License for more details.                                |
00017         |                                                                             |
00018         | You should have received a copy of the GNU General Public License           |
00019         | along with this program; if not, write to the Free Software                 |
00020         | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. |
00021         +-----------------------------------------------------------------------------+
00022 */
00023 /*
00024         Script to mimimze all JS sources for the RTE into one file
00025         @author Hendrik Holtmann <holtmann@mac.com>
00026         
00027         This software is provided "AS IS," without a warranty of any kind.  ALL 
00028         EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING 
00029         ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE 
00030         OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.  ADL Co-Lab Hub AND ITS LICENSORS 
00031         SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 
00032         USING, MODIFYING OR DISTRIBUTING THE SOFTWARE OR ITS DERIVATIVES.  IN NO 
00033         EVENT WILL ADL Co-Lab Hub OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, 
00034         PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, 
00035         INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE 
00036         THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE 
00037         SOFTWARE, EVEN IF ADL Co-Lab Hub HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH 
00038         DAMAGES.
00039 */
00040 
00041         require_once "JSMin_lib.php";
00042 
00043         //location of the RTE-script-files
00044         $location = "../scripts";
00045         
00046         //list all scripts that are needed for the RTE
00047         $mandatory_scripts = array( "sequencer/ADLAuxiliaryResource.js",
00048                                                             "sequencer/ADLDuration.js",
00049                                                                 "sequencer/ADLLaunch.js",
00050                                                                 "sequencer/ADLObjStatus.js",
00051                                                                 "sequencer/ADLSeqUtilities.js",
00052                                                                 "sequencer/ADLSequencer.js",
00053                                                                 "sequencer/ADLTOC.js",
00054                                                                 "sequencer/ADLTracking.js",
00055                                                                 "sequencer/ADLValidRequests.js",
00056                                                                 "sequencer/Basics.js",
00057                                                                 "sequencer/SeqActivity.js",
00058                                                                 "sequencer/SeqActivityTree.js",
00059                                                                 "sequencer/SeqCondition.js",
00060                                                                 "sequencer/SeqConditionSet.js",
00061                                                                 "sequencer/SeqNavRequest.js",
00062                                                                 "sequencer/SeqObjective.js",
00063                                                                 "sequencer/SeqObjectiveMap.js",
00064                                                                 "sequencer/SeqObjectiveTracking.js",
00065                                                                 "sequencer/SeqRollupRule.js",
00066                                                                 "sequencer/SeqRollupRuleset.js",
00067                                                                 "sequencer/SeqRule.js",
00068                                                                 "sequencer/SeqRuleset.js",
00069                                                                 "rtemain/main.js",
00070                                                                 "rtemain/rte.js");
00071   
00072         
00073         //minimize all scripts
00074         foreach ($mandatory_scripts as $file) {
00075                 $inp = file_get_contents($location."/".$file);
00076                 $jsMin = new JSMin($inp, false);
00077                 $jsMin->minify();
00078                 $outjsmin[] = $jsMin->out;
00079                 $out[] = $inp;
00080         }
00081         $timestamp = time();
00082         $f_time=date("YndHis",$timestamp);
00083         $comment="// Build: $f_time \n";
00084         $outjsmin = implode("", $outjsmin);
00085         $out = implode("", $out);
00086         $outjsmin=$comment.$outjsmin;
00087         $out=$comment.$out;
00088         $filenamemin="../scripts/buildrte/rte-min.js";
00089         $filename="../scripts/buildrte/rte.js";
00090         file_put_contents($filenamemin, $outjsmin);
00091         file_put_contents($filename, $out);
00092 ?>

Generated on Fri Dec 13 2013 17:56:52 for ILIAS Release_3_9_x_branch .rev 46835 by  doxygen 1.7.1