Updated phpdoc comments packages.

Updated code to improve coding conventions respect
skala
Yannick Warnier 16 years ago
parent fd85b5e710
commit 645d73ec59
  1. 2
      main/newscorm/README.txt
  2. 47
      main/newscorm/aicc.class.php
  3. 11
      main/newscorm/aiccBlock.class.php
  4. 41
      main/newscorm/aiccItem.class.php
  5. 11
      main/newscorm/aiccObjective.class.php
  6. 17
      main/newscorm/aiccResource.class.php
  7. 15
      main/newscorm/aicc_api.php
  8. 21
      main/newscorm/aicc_hacp.php
  9. 5
      main/newscorm/back_compat.inc.php
  10. 7
      main/newscorm/content_makers.inc.php
  11. 8
      main/newscorm/display_audiorecorder.php
  12. 9
      main/newscorm/index.php
  13. 5
      main/newscorm/learnpathList.class.php
  14. 41
      main/newscorm/learnpath_functions.inc.php
  15. 49
      main/newscorm/lp_add.php
  16. 47
      main/newscorm/lp_admin_view.php
  17. 5
      main/newscorm/lp_ajax_initialize.php
  18. 7
      main/newscorm/lp_ajax_last_update_status.php
  19. 5
      main/newscorm/lp_ajax_save_objectives.php
  20. 6
      main/newscorm/lp_ajax_start_timer.php
  21. 5
      main/newscorm/lp_ajax_switch_item.php
  22. 5
      main/newscorm/lp_ajax_switch_item_toc.php
  23. 5
      main/newscorm/lp_api.php
  24. 5
      main/newscorm/lp_author_image.php
  25. 43
      main/newscorm/lp_build.php
  26. 5
      main/newscorm/lp_comm.common.php
  27. 5
      main/newscorm/lp_comm.server.php
  28. 32
      main/newscorm/lp_edit.php
  29. 60
      main/newscorm/lp_edit_item.php
  30. 49
      main/newscorm/lp_edit_item_prereq.php
  31. 5
      main/newscorm/lp_export.php
  32. 5
      main/newscorm/lp_footer.php
  33. 5
      main/newscorm/lp_header.php
  34. 3
      main/newscorm/lp_list_search.php
  35. 5
      main/newscorm/lp_log.php
  36. 11
      main/newscorm/lp_message.php
  37. 11
      main/newscorm/lp_nav.php
  38. 7
      main/newscorm/lp_toc.php
  39. 13
      main/newscorm/openoffice_document.class.php
  40. 12
      main/newscorm/openoffice_presentation.class.php
  41. 9
      main/newscorm/openoffice_text.class.php
  42. 13
      main/newscorm/openoffice_text_document.class.php
  43. 43
      main/newscorm/resourcelinker.inc.php
  44. 120
      main/newscorm/resourcelinker.php
  45. 41
      main/newscorm/scorm.class.php
  46. 26
      main/newscorm/scorm.lib.php
  47. 41
      main/newscorm/scormItem.class.php
  48. 82
      main/newscorm/scormMetadata.class.php
  49. 88
      main/newscorm/scormOrganization.class.php
  50. 38
      main/newscorm/scormResource.class.php
  51. 33
      main/newscorm/scorm_admin.php
  52. 2
      main/newscorm/scorm_api.php
  53. 6
      main/newscorm/scorm_manage.php

@ -12,4 +12,4 @@ Please note this DOES NOT manage the Dokeos learnpaths yet.
For more detailed development information, please read the corresponding Wiki page: http://www.dokeos.com/wiki/index.php/SCORM_tool_redesign
For any problem contact me directly at <yannick.warnier@dokeos.com>
For any problem contact me directly at <yannick.warnier@beeznest.com>

@ -1,13 +1,10 @@
<?php //$id:$
<?php
/* For licensing terms, see /license.txt */
/**
* Defines the AICC class, which is meant to contain the aicc items (nuclear elements)
* @package dokeos.learnpath
* @package chamilo.learnpath
* @author Yannick Warnier <ywarnier@beeznest.org>
* @license GNU/GPL - See Dokeos license directory for details
*/
/**
* Defines the "aicc" child of class "learnpath"
* @package dokeos.learnpath.aicc
* @license GNU/GPL
*/
require_once 'aiccItem.class.php';
//require_once 'aiccMetadata.class.php';
@ -17,12 +14,12 @@ require_once 'aiccBlock.class.php';
class aicc extends learnpath {
var $config = array();
var $config_basename = ''; //the configuration files might be multiple and might have
public $config = array();
public $config_basename = ''; //the configuration files might be multiple and might have
//funny names. We need to keep the name of that file while we
//install the content.
var $config_files = array();
var $config_exts = array(
public $config_files = array();
public $config_exts = array(
'crs'=>0, //Course description file (mandatory)
'au' =>0, //Assignable Unit file (mandatory)
'des'=>0, //Descriptor file (mandatory)
@ -31,25 +28,25 @@ class aicc extends learnpath {
'pre'=>0, //Prerequisites file (optional)
'cmp'=>0 //Completion Requirements file (optional)
);
var $aulist = array();
var $au_order_list = array();
var $au_order_list_new_id = array();
var $deslist = array();
var $cstlist = array();
var $orelist = array();
var $subdir = ''; //path between the scorm/ directory and the config files e.g. maritime_nav/maritime_nav. This is the path that will be used in the lp_path when importing a package
var $zipname = ''; //keeps the zipfile safe for the object's life so that we can use it if no title avail
var $lastzipnameindex = 0; //keeps an index of the number of uses of the zipname so far
var $config_encoding = 'ISO-8859-1';
var $debug = 0;
public $aulist = array();
public $au_order_list = array();
public $au_order_list_new_id = array();
public $deslist = array();
public $cstlist = array();
public $orelist = array();
public $subdir = ''; //path between the scorm/ directory and the config files e.g. maritime_nav/maritime_nav. This is the path that will be used in the lp_path when importing a package
public $zipname = ''; //keeps the zipfile safe for the object's life so that we can use it if no title avail
public $lastzipnameindex = 0; //keeps an index of the number of uses of the zipname so far
public $config_encoding = 'ISO-8859-1';
public $debug = 0;
/**
* Class constructor. Based on the parent constructor.
* @param string Course code
* @param integer Learnpath ID in DB
* @param integer User ID
*/
function aicc($course_code=null,$resource_id=null,$user_id=null) {
public function __construct($course_code=null,$resource_id=null,$user_id=null) {
if($this->debug>0){error_log('In aicc::aicc()',0);}
if(!empty($course_code) and !empty($resource_id) and !empty($user_id))
{
@ -62,7 +59,7 @@ class aicc extends learnpath {
* Opens a resource
* @param integer Database ID of the resource
*/
function open($id)
public function open($id)
{
if($this->debug>0){error_log('In aicc::open()',0);}
// redefine parent method

@ -1,9 +1,10 @@
<?php //$id:$
<?php
/* For licensing terms, see /license.txt */
/**
* Container for the aiccResource class that deals with elemens from AICC Course Structure file
* @package dokeos.learnpath
* @package chamilo.learnpath
* @author Yannick Warnier <ywarnier@beeznest.org>
* @license GNU/GPL - See Dokeos license directory for details
* @license GNU/GPL
*/
/**
* Class defining the Block elements in an AICC Course Structure file
@ -11,8 +12,8 @@
*/
require_once 'learnpathItem.class.php';
class aiccBlock extends learnpathItem{
var $identifier = '';
var $members = array();
public $identifier = '';
public $members = array();
/**
* Class constructor. Depending of the type of construction called ('db' or 'manifest'), will create a scormResource

@ -1,31 +1,32 @@
<?php //$id:$
<?php
/* For licensing terms, see /license.txt */
/**
* Container for the aiccItem class that deals with AICC Assignable Units (AUs)
* @package dokeos.learnpath
* @package chamilo.learnpath
* @author Yannick Warnier <ywarnier@beeznest.org>
* @license GNU/GPL - See Dokeos license directory for details
* @license GNU/GPL
*/
/**
* This class handles the elements from an AICC Descriptor file.
*/
require_once 'learnpathItem.class.php';
class aiccItem extends learnpathItem{
var $identifier = '';//AICC AU's system_id
var $identifierref = '';
var $parameters = ''; //AICC AU's web_launch
var $title = ''; //no AICC equivalent
var $sub_items = array(); //AICC elements (des)
//var $prerequisites = ''; - defined in learnpathItem.class.php
//var $max_score = ''; //defined in learnpathItem
//var $path = ''; //defined in learnpathItem
var $maxtimeallowed = '00:00:00'; //AICC AU's max_time_allowed
var $timelimitaction = ''; //AICC AU's time_limit_action
var $masteryscore = ''; //AICC AU's mastery_score
var $core_vendor = ''; //AICC AU's core_vendor
var $system_vendor = ''; //AICC AU's system_vendor
var $au_type = ''; //AICC AU's type
var $command_line = ''; //AICC AU's command_line
var $debug=0;
public $identifier = '';//AICC AU's system_id
public $identifierref = '';
public $parameters = ''; //AICC AU's web_launch
public $title = ''; //no AICC equivalent
public $sub_items = array(); //AICC elements (des)
//public $prerequisites = ''; - defined in learnpathItem.class.php
//public $max_score = ''; //defined in learnpathItem
//public $path = ''; //defined in learnpathItem
public $maxtimeallowed = '00:00:00'; //AICC AU's max_time_allowed
public $timelimitaction = ''; //AICC AU's time_limit_action
public $masteryscore = ''; //AICC AU's mastery_score
public $core_vendor = ''; //AICC AU's core_vendor
public $system_vendor = ''; //AICC AU's system_vendor
public $au_type = ''; //AICC AU's type
public $command_line = ''; //AICC AU's command_line
public $debug=0;
/**
* Class constructor. Depending of the type of construction called ('db' or 'manifest'), will create a scormItem
@ -33,7 +34,7 @@ class aiccItem extends learnpathItem{
* @param string Type of construction needed ('db' or 'config', default = 'config')
* @param mixed Depending on the type given, DB id for the lp_item or parameters array
*/
function aiccItem($type='config',$params) {
public function aiccItem($type='config',$params) {
if(isset($params))
{
switch($type){

@ -1,9 +1,10 @@
<?php //$id:$
<?php
/* For licensing terms, see /license.txt */
/**
* Container for the aiccResource class that deals with elemens from AICC Objectives file
* @package dokeos.learnpath
* @package chamilo.learnpath
* @author Yannick Warnier <ywarnier@beeznest.org>
* @license GNU/GPL - See Dokeos license directory for details
* @license GNU/GPL
*/
/**
* Class defining the Block elements in an AICC Course Structure file
@ -11,8 +12,8 @@
*/
require_once 'learnpathItem.class.php';
class aiccObjective extends learnpathItem{
var $identifier = '';
var $members = array();
public $identifier = '';
public $members = array();
/**
* Class constructor. Depending of the type of construction called ('db' or 'manifest'), will create a scormResource

@ -1,18 +1,19 @@
<?php //$id:$
<?php
/* For licensing terms, see /license.txt */
/**
* Container for the aiccResource class that deals with elemens from AICC Descriptor file
* @package dokeos.learnpath
* @package chamilo.learnpath
* @author Yannick Warnier <ywarnier@beeznest.org>
* @license GNU/GPL - See Dokeos license directory for details
* @license GNU/GPL
*/
/**
* Class defining the elements from an AICC Descriptor file
*/
class aiccResource {
var $identifier = '';
var $title = '';
var $description = '';
var $developer_id = '';
public $identifier = '';
public $title = '';
public $description = '';
public $developer_id = '';
/**
* Class constructor. Depending of the type of construction called ('db' or 'manifest'), will create a scormResource
@ -20,7 +21,7 @@ class aiccResource {
* @param string Type of construction needed ('db' or 'config', default = 'config')
* @param mixed Depending on the type given, DB id for the lp_item or parameters array
*/
function aiccResource($type='config',$params) {
public function aiccResource($type='config',$params) {
if(isset($params))
{

@ -1,15 +1,14 @@
<?php // $Id: $
<?php
/* For licensing terms, see /license.txt */
/**
==============================================================================
* API event handler functions for AICC / CMIv4 in API communication mode
*
* @author Denes Nagy <darkden@freemail.hu>
* @author Yannick Warnier <ywarnier@beeznest.org>
* @version v 1.0
* @access public
* @package dokeos.learnpath
* @license GNU/GPL - See Dokeos license directory for details
==============================================================================
* @package chamilo.learnpath
* @license GNU/GPL
*/
/**
* This script is divided into three sections.
@ -22,10 +21,8 @@
* made by another set of scripts.
*/
/*
==============================================================================
INIT SECTION
==============================================================================
*/
* INIT SECTION
*/
//flag to allow for anonymous user - needs to be set before global.inc.php
$use_anonymous = true;

@ -1,16 +1,15 @@
<?php // $Id: $
/* For licensing terms, see /license.txt */
/**
==============================================================================
* API event handler functions for AICC / CMIv4 in HACP communication mode
*
* @author Denes Nagy <darkden@freemail.hu>
* @author Yannick Warnier <ywarnier@beeznest.org>
* @version v 1.0
* @access public
* @package dokeos.learnpath
* @license GNU/GPL - See Dokeos license directory for details
==============================================================================
*/
* API event handler functions for AICC / CMIv4 in HACP communication mode
*
* @author Denes Nagy <darkden@freemail.hu>
* @author Yannick Warnier <ywarnier@beeznest.org>
* @version v 1.0
* @access public
* @package chamilo.learnpath
* @license GNU/GPL
*/
/**
* This script is divided into three sections.
* The first section (below) is the initialisation part.

@ -1,10 +1,11 @@
<?php //$id: $
<?php
/* For licensing terms, see /license.txt */
/**
* This script used to allow compatibility between the New SCORM tool and both
* version 1.6.3 and 1.8 of Dokeos by loading libraries in a different way.
* The switch is now deprecated and this file will be renamed later on to
* something like lp_includes.inc.php
* @package dokeos.learnpath
* @package chamilo.learnpath
*/
require_once '../inc/global.inc.php';
require_once api_get_path(LIBRARY_PATH).'database.lib.php';

@ -1,8 +1,9 @@
<?php //$id: $
<?php
/* For licensing terms, see /license.txt */
/**
* The only usage of this script is to have a portable way of keeping the list of content makers
* @package dokeos.learnpath
* @author Yannick Warnier <yannick.warnier@dokeos.com>
* @package chamilo.learnpath
* @author Yannick Warnier <yannick.warnier@beeznest.com>
*/
/**
* Script

@ -1,10 +1,10 @@
<?php //$id: $
// This file is part of the Dokeos software - See license and credits in the documentation/ directory
<?php
/* For licensing terms, see /license.txt */
/**
* Script opened in an iframe and containing the learning path's table of contents
* @package dokeos.learnpath
* @package chamilo.learnpath
* @author Yannick Warnier <ywarnier@beeznest.org>
* @license GNU/GPL - See Dokeos license directory for details
* @license GNU/GPL
*/
//flag to allow for anonymous user - needs to be set before global.inc.php
$use_anonymous = true;

@ -1,16 +1,15 @@
<?php //$id: $
<?php
/* For licensing terms, see /license.txt */
/**
* Redirection script
* @package dokeos.learnpath
* @package chamilo.learnpath
* @author Yannick Warnier <ywarnier@beeznest.org>
*/
/**
* Script
*/
//flag to allow for anonymous user - needs to be set before global.inc.php
$use_anonymous = true;
require 'back_compat.inc.php';
header('location: lp_controller.php?'.api_get_cidReq().'&action=list');
?>
header('location: lp_controller.php?'.api_get_cidReq().'&action=list');

@ -1,7 +1,8 @@
<?php //$id:$
<?php
/* For licensing terms, see /license.txt */
/**
* File containing the declaration of the learnpathList class.
* @package dokeos.learnpath
* @package chamilo.learnpath
* @author Yannick Warnier <ywarnier@beeznest.org>
*/
/**

@ -1,27 +1,6 @@
<?php // $Id: index.php 16620 2008-10-25 20:03:54Z yannoo $
/*
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2004-2008 Dokeos SPRL
Copyright (c) 2003 Ghent University (UGent)
For a full list of contributors, see "credits.txt".
The full license can be read in "license.txt".
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 the GNU General Public License for more details.
Contact: Dokeos, rue Notre Dame, 152, B-1140 Evere, Belgium, info@dokeos.com
==============================================================================
*/
<?php
/* For licensing terms, see /license.txt */
/**
==============================================================================
* This is a function library for the learning path.
*
* Due to the face that the learning path has been built upon the resoucelinker,
@ -36,15 +15,13 @@
*
* @author Denes Nagy <darkden@evk.bke.hu>, main author
* @author Roan Embrechts, some code cleaning
* @author Yannick Warnier <yannick.warnier@dokeos.com>, multi-level learnpath behaviour + new SCORM tool
* @author Yannick Warnier <yannick.warnier@beeznest.com>, multi-level learnpath behaviour + new SCORM tool
* @access public
* @package dokeos.learnpath
* @package chamilo.learnpath
* @todo rename functions to coding conventions: not deleteitem but delete_item, etc
* @todo rewrite functions to comply with phpDocumentor
* @todo remove code duplication
==============================================================================
*/
/**
* This function deletes an item
* @param integer $id: the item we want to delete
@ -406,7 +383,7 @@ function array_learnpath_categories()
* @todo eliminate all global $lang declarations, use get_lang, improve structure.
* @author Denes Nagy
* @author Roan Embrechts
* @author Yannick Warnier <yannick.warnier@dokeos.com> - complete redesign for multi-level learnpath chapters
* @author Yannick Warnier <yannick.warnier@beeznest.com> - complete redesign for multi-level learnpath chapters
*/
function display_learnpath_chapters($parent_item_id = 0, $tree = array (), $level = 0)
{
@ -1037,7 +1014,7 @@ function prereqcheck($id_in_path)
* Constructs the tree that will be used to build the learnpath structure
* @params integer Learnpath_id
* @return array Tree of the learnpath structure
* @author Yannick Warnier <yannick.warnier@dokeos.com>
* @author Yannick Warnier <yannick.warnier@beeznest.com>
* @comment This is a temporary function, which exists while the chapters and items
* are still in separate tables in the database. This function gathers the data in a unique tree.
**/
@ -1109,7 +1086,7 @@ function get_learnpath_tree($learnpath_id)
* @param integer The chapter id to start from
* @param boolean Whether to include chapters or not
* @return array List of elements in the first to last order
* @author Yannick Warnier <yannick.warnier@dokeos.com>
* @author Yannick Warnier <yannick.warnier@beeznest.com>
**/
function get_ordered_items_list($tree, $chapter = 0, $include_chapters = false)
{
@ -1145,7 +1122,7 @@ function get_ordered_items_list($tree, $chapter = 0, $include_chapters = false)
* @param boolean Indicates if the style is wrapped (true) or extended (false)
* @param integer Level reached so far in the tree depth (enables recursive behaviour)
* @return array Number of items, Number of items completed
* @author Many changes by Yannick Warnier <yannick.warnier@dokeos.com>
* @author Many changes by Yannick Warnier <yannick.warnier@beeznest.com>
**/
function display_toc_chapter_contents($tree, $parent_item_id = 0, $learnpath_id, $uid, $wrap, $level = 0)
{
@ -1251,7 +1228,7 @@ function display_toc_chapter_contents($tree, $parent_item_id = 0, $learnpath_id,
* @param array Tree of elements as returned by get_learnpath_tree()
* @param integer Level of recursivity we have reached
* @param integer Counter of elements already displayed
* @author Yannick Warnier <yannick.warnier@dokeos.com>
* @author Yannick Warnier <yannick.warnier@beeznest.com>
* @note : forced display because of display_addedresource_link_in_learnpath behaviour (outputing a string would be better)
**/
function get_tracking_table($learnpath_id, $user_id, $parent_item_id = 0, $tree = false, $level = 0, $counter = 0)

@ -1,42 +1,17 @@
<?php // $Id: index.php 16620 2008-10-25 20:03:54Z yannoo $
/*
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2004-2008 Dokeos SPRL
Copyright (c) 2003 Ghent University (UGent)
For a full list of contributors, see "credits.txt".
The full license can be read in "license.txt".
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 the GNU General Public License for more details.
Contact: Dokeos, rue Notre Dame, 152, B-1140 Evere, Belgium, info@dokeos.com
==============================================================================
*/
<?php
/* For licensing terms, see /license.txt */
/**
==============================================================================
* This is a learning path creation and player tool in Dokeos - previously learnpath_handler.php
*
* @author Patrick Cool
* @author Denes Nagy
* @author Roan Embrechts, refactoring and code cleaning
* @author Yannick Warnier <ywarnier@beeznest.org> - cleaning and update for new SCORM tool
* @package dokeos.learnpath
==============================================================================
*/
* This is a learning path creation and player tool in Dokeos - previously learnpath_handler.php
*
* @author Patrick Cool
* @author Denes Nagy
* @author Roan Embrechts, refactoring and code cleaning
* @author Yannick Warnier <ywarnier@beeznest.org> - cleaning and update for new SCORM tool
* @package chamilo.learnpath
*/
/*
==============================================================================
INIT SECTION
==============================================================================
*/
* INIT SECTION
*/
$this_section=SECTION_COURSES;
api_protect_course_script();

@ -1,43 +1,18 @@
<?php // $Id: index.php 16620 2008-10-25 20:03:54Z yannoo $
/*
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2004-2008 Dokeos SPRL
Copyright (c) 2003 Ghent University (UGent)
For a full list of contributors, see "credits.txt".
The full license can be read in "license.txt".
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 the GNU General Public License for more details.
Contact: Dokeos, rue Notre Dame, 152, B-1140 Evere, Belgium, info@dokeos.com
==============================================================================
*/
<?php
/* For licensing terms, see /license.txt */
/**
==============================================================================
* This is a learning path creation and player tool in Dokeos - previously learnpath_handler.php
*
* @author Patrick Cool
* @author Denes Nagy
* @author Roan Embrechts, refactoring and code cleaning
* @author Yannick Warnier <ywarnier@beeznest.org> - cleaning and update for new SCORM tool
* @package dokeos.learnpath
==============================================================================
* This is a learning path creation and player tool in Dokeos - previously learnpath_handler.php
*
* @author Patrick Cool
* @author Denes Nagy
* @author Roan Embrechts, refactoring and code cleaning
* @author Yannick Warnier <ywarnier@beeznest.org> - cleaning and update for new SCORM tool
* @package chamilo.learnpath
*/
/*
==============================================================================
INIT SECTION
==============================================================================
*/
* INIT SECTION
*/
$this_section=SECTION_COURSES;
api_protect_course_script();

@ -1,10 +1,11 @@
<?php //$id$
<?php
/* For licensing terms, see /license.txt */
/**
* This script contains the server part of the xajax interaction process. The client part is located
* in lp_api.php or other api's.
* This script, in particular, enables the process of SCO's initialization. It
* resets the JavaScript values for each SCO to the current LMS status.
* @package dokeos.learnpath
* @package chamilo.learnpath
* @author Yannick Warnier <ywarnier@beeznest.org>
*/
/**

@ -1,4 +1,5 @@
<?php //$id$
<?php
/* For licensing terms, see /license.txt */
/**
* This script contains the server part of the xajax interaction process. The
* client part is located in lp_api.php or other api's.
@ -15,8 +16,8 @@
* whether the raw score is higher than the mastery score. If not, the status
* will be set to 'failed', if yes, the status will be set to 'passed'
* 5 - update the status in the table of contents
* @package dokeos.learnpath
* @author Yannick Warnier <yannick.warnier@dokeos.com>
* @package chamilo.learnpath
* @author Yannick Warnier <yannick.warnier@beeznest.com>
*/
//flag to allow for anonymous user - needs to be set before global.inc.php
$use_anonymous = true;

@ -1,9 +1,10 @@
<?php //$id$
<?php
/* For licensing terms, see /license.txt */
/**
* This script contains the server part of the xajax interaction process. The client part is located
* in lp_api.php or other api's.
* This is a first attempt at using xajax and AJAX in general, so the code might be a bit unsettling.
* @package dokeos.learnpath
* @package chamilo.learnpath
* @author Yannick Warnier <ywarnier@beeznest.org>
*/
/**

@ -1,14 +1,16 @@
<?php //$id$
<?php
/* For licensing terms, see /license.txt */
/**
* This script contains the server part of the xajax interaction process. The client part is located
* in lp_api.php or other api's.
* This is a first attempt at using xajax and AJAX in general, so the code might be a bit unsettling.
* @package dokeos.learnpath
* @package chamilo.learnpath
* @author Yannick Warnier <ywarnier@beeznest.org>
*/
/**
* Start a timer and hand it back to the JS by assigning the current time (of start) to
* var asset_timer
* @return string JavaScript time intializer
*/
function start_timer()
{

@ -1,9 +1,10 @@
<?php //$id$
<?php
/* For licensing terms, see /license.txt */
/**
* This script contains the server part of the xajax interaction process. The client part is located
* in lp_api.php or other api's.
* This is a first attempt at using xajax and AJAX in general, so the code might be a bit unsettling.
* @package dokeos.learnpath
* @package chamilo.learnpath
* @author Yannick Warnier <ywarnier@beeznest.org>
*/
/**

@ -1,9 +1,10 @@
<?php //$id$
<?php
/* For licensing terms, see /license.txt */
/**
* This script contains the server part of the xajax interaction process. The client part is located
* in lp_api.php or other api's.
* This script updated the TOC of the SCORM without updating the SCO's attributes
* @package dokeos.learnpath
* @package chamilo.learnpath
* @author Yannick Warnier <ywarnier@beeznest.org>
*/
/**

@ -1,8 +1,9 @@
<?php //$id: $
<?php
/* For licensing terms, see /license.txt */
/**
* DEPRECATED (temporarily left here)
* Script that displays the footer frame for lp_view.php
* @package dokeos.learnpath
* @package chamilo.learnpath
* @author Yannick Warnier <ywarnier@beeznest.org>
*/
/**

@ -1,7 +1,8 @@
<?php //$id: $
<?php
/* For licensing terms, see /license.txt */
/**
* Script that displays the author name and image of a LP
* @package dokeos.learnpath
* @package chamilo.learnpath
* @author Julio Montoya Armas <gugli100@gmail.com>
*/

@ -1,37 +1,14 @@
<?php // $Id: index.php 16620 2008-10-25 20:03:54Z yannoo $
/*
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2004-2008 Dokeos SPRL
Copyright (c) 2003 Ghent University (UGent)
For a full list of contributors, see "credits.txt".
The full license can be read in "license.txt".
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 the GNU General Public License for more details.
Contact: Dokeos, rue Notre Dame, 152, B-1140 Evere, Belgium, info@dokeos.com
==============================================================================
*/
<?php
/* For licensing terms, see /license.txt */
/**
==============================================================================
* This is a learning path creation and player tool in Dokeos - previously learnpath_handler.php
*
* @author Patrick Cool
* @author Denes Nagy
* @author Roan Embrechts, refactoring and code cleaning
* @author Yannick Warnier <ywarnier@beeznest.org> - cleaning and update for new SCORM tool
* @package dokeos.learnpath
==============================================================================
*/
* This is a learning path creation and player tool in Dokeos - previously learnpath_handler.php
*
* @author Patrick Cool
* @author Denes Nagy
* @author Roan Embrechts, refactoring and code cleaning
* @author Yannick Warnier <ywarnier@beeznest.org> - cleaning and update for new SCORM tool
* @package chamilo.learnpath
*/
/*
==============================================================================

@ -1,9 +1,10 @@
<?php //$id: $
<?php
/* For licensing terms, see /license.txt */
/**
* This script contains the server part of the xajax interaction process. The client part is located
* in lp_api.php or other api's.
* This is a first attempt at using xajax and AJAX in general, so the code might be a bit unsettling.
* @package dokeos.learnpath
* @package chamilo.learnpath
* @author Yannick Warnier <ywarnier@beeznest.org>
*/
/**

@ -1,9 +1,10 @@
<?php //$id: $
<?php
/* For licensing terms, see /license.txt */
/**
* This script contains the server part of the xajax interaction process. The client part is located
* in lp_api.php or other api's.
* This is a first attempt at using xajax and AJAX in general, so the code might be a bit unsettling.
* @package dokeos.learnpath
* @package chamilo.learnpath
* @author Yannick Warnier <ywarnier@beeznest.org>
*/
/**

@ -1,7 +1,8 @@
<?php //$id: $
<?php
/* For licensing terms, see /license.txt */
/**
* Script allowing simple edition of learnpath information (title, description, etc)
* @package dokeos.learnpath
* @package chamilo.learnpath
* @author Yannick Warnier <ywarnier@beeznest.org>
*/
@ -16,7 +17,7 @@ $this_section=SECTION_COURSES;
event_access_tool(TOOL_LEARNPATH);
if (! $is_allowed_in_course) api_not_allowed();
if (isset($_SESSION['gradebook'])){
if (isset($_SESSION['gradebook'])) {
$gradebook= $_SESSION['gradebook'];
}
@ -63,7 +64,7 @@ $form->addRule('lp_name', get_lang('ThisFieldIsRequired'), 'required');
//Encoding
$encoding_select = &$form->addElement('select', 'lp_encoding', get_lang('Charset'));
$encodings = array('UTF-8','ISO-8859-1','ISO-8859-15','cp1251','cp1252','KOI8-R','BIG5','GB2312','Shift_JIS','EUC-JP');
foreach($encodings as $encoding){
foreach ($encodings as $encoding) {
if (api_equal_encodings($encoding, $_SESSION['oLP']->encoding)) {
$s_selected_encoding = $encoding;
}
@ -76,8 +77,8 @@ $origin_select = &$form->addElement('select', 'lp_maker', get_lang('Origin'));
$lp_orig = $_SESSION['oLP']->get_maker();
include 'content_makers.inc.php';
foreach($content_origins as $origin){
if($lp_orig == $origin){
foreach ($content_origins as $origin) {
if ($lp_orig == $origin) {
$s_selected_origin = $origin;
}
$origin_select->addOption($origin,$origin);
@ -87,20 +88,18 @@ foreach($content_origins as $origin){
//Content proximity
$content_proximity_select = &$form->addElement('select', 'lp_proximity', get_lang('ContentProximity'));
$lp_prox = $_SESSION['oLP']->get_proximity();
if($lp_prox != 'local'){
if ($lp_prox != 'local') {
$s_selected_proximity = 'remote';
}else{
} else {
$s_selected_proximity = 'local';
}
$content_proximity_select->addOption(get_lang('Local'), 'local');
$content_proximity_select->addOption(get_lang('Remote'), 'remote');
if (api_get_setting('allow_course_theme') == 'true')
{
if (api_get_setting('allow_course_theme') == 'true') {
$mycourselptheme=api_get_course_setting('allow_learning_path_theme');
if (!empty($mycourselptheme) && $mycourselptheme!=-1 && $mycourselptheme== 1)
{
if (!empty($mycourselptheme) && $mycourselptheme!=-1 && $mycourselptheme== 1) {
//LP theme picker
$theme_select = &$form->addElement('select_theme', 'lp_theme', get_lang('Theme'));
$form->applyFilter('lp_theme', 'trim');
@ -116,8 +115,7 @@ $form->applyFilter('lp_author', 'html_filter');
// LP image
$form->add_progress_bar();
if( strlen($_SESSION['oLP']->get_preview_image() ) > 0)
{
if ( strlen($_SESSION['oLP']->get_preview_image() ) > 0) {
$show_preview_image='<img src='.api_get_path(WEB_COURSE_PATH).api_get_course_path().'/upload/learning_path/images/'.$_SESSION['oLP']->get_preview_image().'>';
$div = '<div class="row">
<div class="label">'.get_lang('ImagePreview').'</div>
@ -136,8 +134,7 @@ $form->addElement('static', null, null, get_lang('ImageWillResizeMsg'));
$form->addRule('lp_preview_image', get_lang('OnlyImagesAllowed'), 'filetype', array ('jpg', 'jpeg', 'png', 'gif'));
// Search terms (only if search is activated)
if (api_get_setting('search_enabled') === 'true')
{
if (api_get_setting('search_enabled') === 'true') {
$specific_fields = get_specific_field_list();
foreach ($specific_fields as $specific_field) {
$form -> addElement ('text', $specific_field['code'], $specific_field['name']);
@ -176,5 +173,4 @@ echo '<table><tr><td width="550px">';
$form -> display();
echo '</td><td valign="top"><img src="../img/course_setting_layout.png" /></td></tr></table>';
Display::display_footer();
?>
Display::display_footer();

@ -1,47 +1,19 @@
<?php
/*
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2004-2008 Dokeos SPRL
Copyright (c) 2003 Ghent University (UGent)
Copyright (c) 2001 Universite catholique de Louvain (UCL)
Copyright (c) Patrick Cool
Copyright (c) Denes Nagy
Copyright (c) Yannick Warnier
For a full list of contributors, see "credits.txt".
The full license can be read in "license.txt".
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 the GNU General Public License for more details.
Contact address: Dokeos, rue du Corbeau, 108, B-1030 Brussels, Belgium
Mail: info@dokeos.com
==============================================================================
*/
/* For licensing terms, see /license.txt */
/**
==============================================================================
* This is a learning path creation and player tool in Dokeos - previously learnpath_handler.php
*
* @author Patrick Cool
* @author Denes Nagy
* @author Roan Embrechts, refactoring and code cleaning
* @author Yannick Warnier <ywarnier@beeznest.org> - cleaning and update for new SCORM tool
* @author Julio Montoya - Improving the list of templates
* @package dokeos.learnpath
==============================================================================
* This is a learning path creation and player tool in Dokeos - previously learnpath_handler.php
*
* @author Patrick Cool
* @author Denes Nagy
* @author Roan Embrechts, refactoring and code cleaning
* @author Yannick Warnier <ywarnier@beeznest.org> - cleaning and update for new SCORM tool
* @author Julio Montoya - Improving the list of templates
* @package chamilo.learnpath
*/
/*
==============================================================================
INIT SECTION
==============================================================================
*/
* INIT SECTION
*/
$this_section=SECTION_COURSES;
api_protect_course_script();
@ -123,12 +95,10 @@ $type = $_REQUEST['type'];
==============================================================================
*/
// using the resource linker as a tool for adding resources to the learning path
if ($action=="add" and $type=="learnpathitem")
{
if ($action=="add" and $type=="learnpathitem") {
$htmlHeadXtra[] = "<script language='JavaScript' type='text/javascript'> window.location=\"../resourcelinker/resourcelinker.php?source_id=5&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no\"; </script>";
}
if ( (! $is_allowed_to_edit) or ($isStudentView) )
{
if ( (! $is_allowed_to_edit) or ($isStudentView) ) {
error_log('New LP - User not authorized in lp_add_item.php');
header('location:lp_controller.php?action=view&lp_id='.$learnpath_id);
}
@ -220,7 +190,7 @@ echo '<table cellpadding="0" cellspacing="0" class="lp_build">';
$path_file=Database::result($res_doc,0,0);
$path_parts = pathinfo($path_file);
if (Database::num_rows($res_doc) > 0 && $path_parts['extension']=='html'){
if (Database::num_rows($res_doc) > 0 && $path_parts['extension']=='html') {
$count_items = count($_SESSION['oLP']->ordered_items);
$style = ($count_items > 12)?' style="height:250px;width:230px;overflow-x : auto; overflow : scroll;" ':' class="lp_tree" ';
echo '<div '.$style.'>';
@ -240,7 +210,7 @@ echo '<table cellpadding="0" cellspacing="0" class="lp_build">';
echo '</td>';
echo '<td class="workspace">';
if(isset($is_success) && $is_success === true) {
if (isset($is_success) && $is_success === true) {
$msg = '<div class="lp_message" style="margin-bottom:10px;">';
$msg .= 'The item has been edited.';
$msg .= '</div>';

@ -1,45 +1,18 @@
<?php
/*
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2004 Dokeos S.A.
Copyright (c) 2003 Ghent University (UGent)
Copyright (c) 2001 Universite catholique de Louvain (UCL)
Copyright (c) Patrick Cool
Copyright (c) Denes Nagy
Copyright (c) Yannick Warnier
For a full list of contributors, see "credits.txt".
The full license can be read in "license.txt".
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 the GNU General Public License for more details.
Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com
==============================================================================
*/
/* For licensing terms, see /license.txt */
/**
==============================================================================
* This is a learning path creation and player tool in Dokeos - previously learnpath_handler.php
*
* @author Patrick Cool
* @author Denes Nagy
* @author Roan Embrechts, refactoring and code cleaning
* @author Yannick Warnier <ywarnier@beeznest.org> - cleaning and update for new SCORM tool
* @package dokeos.learnpath
==============================================================================
*/
* This is a learning path creation and player tool in Dokeos - previously learnpath_handler.php
*
* @author Patrick Cool
* @author Denes Nagy
* @author Roan Embrechts, refactoring and code cleaning
* @author Yannick Warnier <ywarnier@beeznest.org> - cleaning and update for new SCORM tool
* @package chamilo.learnpath
*/
/*
==============================================================================
INIT SECTION
==============================================================================
*/
* INIT SECTION
*/
$this_section=SECTION_COURSES;
api_protect_course_script();

@ -1,4 +1,5 @@
<?php //$id: $
<?php
/* For licensing terms, see /license.txt */
/**
* Script to export the current path as a SCORM zip package.
* This script cannot use the common controller lp_controller.php because we need to keep
@ -9,7 +10,7 @@
* to force the download and let the user do the rest. This script should not change the screen
* at all, so the user will still be able to continue what he was doing.
* @todo get some ID proof
* @package dokeos.learnpath
* @package chamilo.learnpath
* @author Yannick Warnier <ywarnier@beeznest.org>
*/
/**

@ -1,7 +1,8 @@
<?php //$id: $
<?php
/* For licensing terms, see /license.txt */
/**
* Script that displays the footer frame for lp_view.php
* @package dokeos.learnpath
* @package chamilo.learnpath
* @author Yannick Warnier <ywarnier@beeznest.org>
*/
/**

@ -1,7 +1,8 @@
<?php //$id: $
<?php
/* For licensing terms, see /license.txt */
/**
* Script that displays the header frame for lp_view.php
* @package dokeos.learnpath
* @package chamilo.learnpath
* @author Yannick Warnier <ywarnier@beeznest.org>
*/
/**

@ -1,9 +1,8 @@
<?php
/* For licensing terms, see /dokeos_license.txt */
/**
* Script to draw the results from a query
* @package: dokeos.learnpath
* @package: chamilo.learnpath
* @author: Diego Escalante Urrelo <diegoe@gmail.com>
* @author: Marco Antonio Villegas Vega <marvil07@gmail.com>
*/

@ -1,4 +1,5 @@
<?php //$id: $
<?php
/* For licensing terms, see /license.txt */
/**
* Container script for the messages coming from the learnpath object. Initially, this wasn't supposed to be
* a separate file but rather some text included in lp_view.php, but SCORM involves loading a script that
@ -10,7 +11,7 @@
* TOC drawn with your 'incomplete' status, while the SCORM messages generally arrives just after the TOC
* is drawn. By updating it here and in lp_save.php, we avoid funny visual effect like having a complete
* item showing as incomplete.
* @package dokeos.learnpath
* @package chamilo.learnpath
* @author Yannick Warnier <ywarnier@beeznest.org>
*/
/**

@ -1,4 +1,5 @@
<?php //$id: $
<?php
/* For licensing terms, see /license.txt */
/**
* Container script for the messages coming from the learnpath object. Initially, this wasn't supposed to be
* a separate file but rather some text included in lp_view.php, but SCORM involves loading a script that
@ -10,7 +11,7 @@
* TOC drawn with your 'incomplete' status, while the SCORM messages generally arrives just after the TOC
* is drawn. By updating it here and in lp_save.php, we avoid funny visual effect like having a complete
* item showing as incomplete.
* @package dokeos.learnpath
* @package chamilo.learnpath
* @author Yannick Warnier <ywarnier@beeznest.org>
*/
/**
@ -23,16 +24,16 @@ $language_file = "learnpath";
require_once 'back_compat.inc.php';
require_once 'learnpath.class.php';
require_once 'scorm.class.php';
if(empty($debug)){$debug=0;}
if (empty($debug)) {$debug=0;}
$error = '';
$display_mode = '';
if(isset($_SESSION['lpobject'])){
if (isset($_SESSION['lpobject'])) {
$temp = $_SESSION['lpobject'];
$_SESSION['oLP'] = unserialize($temp);
$error = $_SESSION['oLP']->error;
$display_mode = $_SESSION['oLP']->mode;
}
if($debug>0){error_log('New LP - Loaded lp_message : '.$_SERVER['REQUEST_URI'].' from '.$_SERVER['HTTP_REFERER'],0);}
if ($debug>0) {error_log('New LP - Loaded lp_message : '.$_SERVER['REQUEST_URI'].' from '.$_SERVER['HTTP_REFERER'],0);}
$htmlHeadXtra[] = '<script language="JavaScript" type="text/javascript">
var dokeos_xajax_handler = window.parent.oxajax;

@ -1,9 +1,10 @@
<?php //$id: $
<?php
/* For licensing terms, see /license.txt */
/**
* Script opened in an iframe and containing the learning path's navigation and progress bar
* @package dokeos.learnpath
* @package chamilo.learnpath
* @author Yannick Warnier <ywarnier@beeznest.org>
* @license GNU/GPL - See Dokeos license directory for details
* @license GNU/GPL
*/
/**
* Script
@ -27,10 +28,10 @@ $navigation_bar = '';
$display_mode = '';
$autostart = 'true';
if(isset($_SESSION['lpobject'])) {
if (isset($_SESSION['lpobject'])) {
//if($debug>0) //error_log('New LP - in lp_nav.php - SESSION[lpobject] is defined',0);
$oLP = unserialize($_SESSION['lpobject']);
if(is_object($oLP)) {
if (is_object($oLP)) {
$_SESSION['oLP'] = $oLP;
} else {
//error_log('New LP - in lp_nav.php - SESSION[lpobject] is not object - dying',0);

@ -2,7 +2,7 @@
/* For licensing terms, see /license.txt */
/**
* Script opened in an iframe and containing the learning path's table of contents
* @package dokeos.learnpath
* @package chamilo.learnpath
* @author Yannick Warnier <ywarnier@beeznest.org>
*/
//flag to allow for anonymous user - needs to be set before global.inc.php
@ -15,8 +15,7 @@ require_once 'learnpath.class.php';
require_once 'scorm.class.php';
require_once 'aicc.class.php';
if(isset($_SESSION['lpobject']))
{
if (isset($_SESSION['lpobject'])) {
//if($debug>0) error_log('New LP - in lp_toc.php - SESSION[lpobject] is defined',0);
$oLP = unserialize($_SESSION['lpobject']);
if(is_object($oLP)){
@ -40,7 +39,7 @@ include_once '../inc/reduced_header.inc.php';
</body>
</html>
<?php
if(!empty($_SESSION['oLP'])){
if (!empty($_SESSION['oLP'])) {
$_SESSION['lpobject'] = serialize($_SESSION['oLP']);
}
?>

@ -1,16 +1,15 @@
<?php //$id:$
<?php
/* For licensing terms, see /license.txt */
/**
* Defines the OpenofficeDocument class, which is meant as a mother class
* to help in the conversion of Office documents to learning paths
* @package dokeos.learnpath
* @package chamilo.learnpath
* @author Eric Marguin <eric.marguin@dokeos.com>
* @license GNU/GPL - See Dokeos license directory for details
* @license GNU/GPL
*/
/**
* Defines the "OpenofficeDocument" child of class "learnpath"
* @package dokeos.learnpath.aicc
*/
abstract class OpenofficeDocument extends learnpath {
@ -24,7 +23,7 @@ abstract class OpenofficeDocument extends learnpath {
* @param integer Learnpath ID in DB
* @param integer User ID
*/
function OpenofficeDocument($course_code=null,$resource_id=null,$user_id=null) {
public function __construct($course_code=null,$resource_id=null,$user_id=null) {
if($this->debug>0){error_log('In OpenofficeDocument::OpenofficeDocument()',0);}
if(!empty($course_code) and !empty($resource_id) and !empty($user_id))
{
@ -34,7 +33,7 @@ abstract class OpenofficeDocument extends learnpath {
}
}
function convert_document($file, $action_after_conversion='make_lp'){
public function convert_document($file, $action_after_conversion='make_lp'){
global $_course, $_user, $_configuration;

@ -1,15 +1,15 @@
<?php //$id:$
<?php
/* For licensing terms, see /license.txt */
/**
* Defines the OpenofficeDocument class, which is meant as a conversion
* tool from Office presentations (.ppt, .sxi, .odp, .pptx) to
* learning paths
* @package dokeos.learnpath
* @package chamilo.learnpath
* @author Eric Marguin <eric.marguin@dokeos.com>
* @license GNU/GPL - See Dokeos license directory for details
* @license GNU/GPL
*/
/**
* Defines the "OpenofficePresentation" child of class "OpenofficeDocument"
* @package dokeos.learnpath.OpenofficeDocument
*/
require_once 'openoffice_document.class.php';
if (api_get_setting('search_enabled')=='true') {
@ -22,7 +22,7 @@ class OpenofficePresentation extends OpenofficeDocument {
public $take_slide_name;
function OpenofficePresentation($take_slide_name=false, $course_code=null, $resource_id=null,$user_id=null) {
public function __construct($take_slide_name=false, $course_code=null, $resource_id=null,$user_id=null) {
$this -> take_slide_name = $take_slide_name;
parent::OpenofficeDocument($course_code, $resource_id, $user_id);
@ -30,7 +30,7 @@ class OpenofficePresentation extends OpenofficeDocument {
}
function make_lp($files=array()) {
public function make_lp($files=array()) {
global $_course;

@ -1,14 +1,15 @@
<?php //$id:$
<?php
/* For licensing terms, see /license.txt */
/**
* Defines the OpenofficeDocument class, which is meant as a conversion
* tool from Office text documents (.doc, .sxw, .odt, .docx) to
* learning paths
* @package dokeos.learnpath
* @package chamilo.learnpath
* @author Eric Marguin <eric.marguin@dokeos.com>
* @license GNU/GPL - See Doke
* @license GNU/GPL
/**
* Defines the "OpenofficeText" child of class "learnpath"
* @package dokeos.learnpath.OpenofficeDocument
* @package chamilo.learnpath.OpenofficeDocument
*/
require_once 'openoffice_document.class.php';
if (api_get_setting('search_enabled')=='true') {

@ -1,14 +1,15 @@
<?php //$id:$
<?php
/* For licensing terms, see /license.txt */
/**
* Defines the OpenOfficeDocument class, which is meant as a conversion
* tool from Office text documents (.doc, .sxw, .odt, .docx) to
* learning paths
* @package dokeos.learnpath
* @package chamilo.learnpath
* @author Eric Marguin <eric.marguin@dokeos.com>
* @license GNU/GPL - See Doke
/**
* Defines the "OpenOfficeTextDocument" child of class "learnpath"
* @package dokeos.learnpath.openofficedocument
* @package chamilo.learnpath.openofficedocument
*/
require_once 'openoffice_document.class.php';
require_once api_get_path(LIBRARY_PATH).'specific_fields_manager.lib.php';
@ -28,8 +29,7 @@ class OpenOfficeTextDocument extends OpenofficeDocument {
* @param integer Creator user id
* @return void
*/
function OpenofficeTextDocument($split_steps=false, $course_code=null, $resource_id=null,$user_id=null)
{
public function __construct($split_steps=false, $course_code=null, $resource_id=null,$user_id=null) {
$this -> split_steps = $split_steps;
parent::OpenofficeDocument($course_code, $resource_id, $user_id);
@ -41,8 +41,7 @@ class OpenOfficeTextDocument extends OpenofficeDocument {
* @param array The files that will compose the generated learning path. Unused so far.
* @return boolean False if file does not exit. Nothing otherwise.
*/
function make_lp($files=array())
{
public function make_lp($files=array()) {
global $_course;
// we get a content where ||page_break|| indicates where the page is broken

@ -1,38 +1,13 @@
<?php // $Id: resourcelinker.inc.php,v 1.15 2006/08/15 16:34:03 yannoo Exp $
/*
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2004-2008 Dokeos SPRL
Copyright (c) 2003 Ghent University (UGent)
Copyright (c) 2001 Universite catholique de Louvain (UCL)
Copyright (c) Patrick Cool (patrick.cool@ugent.be)
Copyright (c) Denes Nagy
For a full list of contributors, see "credits.txt".
The full license can be read in "license.txt".
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 the GNU General Public License for more details.
Contact address: Dokeos, rue du Corbeau, 108, B-1030 Brussels, Belgium
Mail: info@dokeos.com
==============================================================================
*/
<?php
/* For licensing terms, see /license.txt */
/**
==============================================================================
* @author Patrick Cool - original version
* @author Denes Nagy - further improvements for learning path builder
* @author Roan Embrechts - refactoring to improve code organisation
* @package dokeos.resourcelinker
* @todo use the constants for the tools
* @todo use Database API instead of creating table names locally.
==============================================================================
*/
* @author Patrick Cool - original version
* @author Denes Nagy - further improvements for learning path builder
* @author Roan Embrechts - refactoring to improve code organisation
* @package chamilo.resourcelinker
* @todo use the constants for the tools
* @todo use Database API instead of creating table names locally.
*/
/*
==============================================================================

@ -1,43 +1,17 @@
<?php
/*
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2004-2005 Dokeos S.A.
Copyright (c) 2003 Ghent University (UGent)
Copyright (c) 2001 Universite catholique de Louvain (UCL)
Copyright (c) Patrick Cool (patrick.cool@ugent.be)
Copyright (c) Denes Nagy
For a full list of contributors, see "credits.txt".
The full license can be read in "license.txt".
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 the GNU General Public License for more details.
Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com
==============================================================================
*/
/* For licensing terms, see /license.txt */
/**
==============================================================================
* @author Patrick Cool, original code
* @author Denes Nagy - many bugfixes and improvements, adjusted for learning path
* @author Roan Embrechts - refactoring, code cleaning
* @package dokeos.resourcelinker
* @todo reorganise code,
* use Database API instead of creating table names locally.
==============================================================================
*/
* @author Patrick Cool, original code
* @author Denes Nagy - many bugfixes and improvements, adjusted for learning path
* @author Roan Embrechts - refactoring, code cleaning
* @package chamilo.resourcelinker
* @todo reorganise code,
* use Database API instead of creating table names locally.
*/
/*
==============================================================================
INIT SECTION
==============================================================================
*/
* INIT SECTION
*/
//flag to allow for anonymous user - needs to be set before global.inc.php
$use_anonymous = true;
// name of the language file that needs to be included
@ -104,8 +78,7 @@ $multi_level_learnpath = true;
MAIN CODE
==============================================================================
*/
if ($from_learnpath == 'yes')
{
if ($from_learnpath == 'yes') {
//start from clear every time in LearnPath Builder
$_SESSION['addedresource'] = null;
$_SESSION['addedresourceid'] = null;
@ -116,8 +89,7 @@ if ($from_learnpath == 'yes')
}
// Process a new chapter?
if (!empty ($_POST['add_chapter']) && !empty ($_POST['title']))
{
if (!empty ($_POST['add_chapter']) && !empty ($_POST['title'])) {
$title = $_POST['title'];
$description = '';
/*if (!empty ($_POST['description']))
@ -132,10 +104,10 @@ if (!empty ($_POST['add_chapter']) && !empty ($_POST['title']))
$res = Database::query($sql);
$row = Database::fetch_array($res);
$lastorder_item = $row['maxi'];
if(empty($lastorder_item)){
if (empty($lastorder_item)) {
$lastorder_item = 0;
$previous = 0;
}else{
} else {
$sql = "SELECT id FROM $tbl_lp_item " .
"WHERE lp_id = $learnpath_id AND parent_item_id=$chapter_id AND display_order = $lastorder_item";
$result = Database::query($sql);
@ -149,12 +121,11 @@ if (!empty ($_POST['add_chapter']) && !empty ($_POST['title']))
//error_log('New LP - Inserting new resource: '.$sql,0);
$res = Database::query($sql);
$my_id = Database::insert_id($res);
if($previous>0){
if ($previous>0) {
$sql = "UPDATE $tbl_lp_item SET next_item_id = $my_id WHERE id=$previous";
$res = Database::query($sql);
}
if ($res !== false)
{
if ($res !== false) {
$title = '';
$description = '';
}
@ -162,37 +133,32 @@ if (!empty ($_POST['add_chapter']) && !empty ($_POST['title']))
}
// This if when a external link is submitted
if (!empty ($_POST['external_link_submit']))
{
if ($external_link == "" || $external_link == "http://")
if (!empty ($_POST['external_link_submit'])) {
if ($external_link == "" || $external_link == "http://") {
$InvalidURL = 1;
else
{
$add = true;
if ($add_2_links != "niet toevoegen")
{
// add external link to the links table.
$pos = strpos($external_link, 'ttp:');
if ($pos == '')
{
$external_link = 'http://'.$external_link;
} else {
$add = true;
if ($add_2_links != "niet toevoegen") {
// add external link to the links table.
$pos = strpos($external_link, 'ttp:');
if ($pos == '')
{
$external_link = 'http://'.$external_link;
}
$sql = "INSERT INTO $link_table (url, title, category_id) VALUES ('$external_link','$external_link','$add_2_links')";
$result = Database::query($sql);
$addedresource[] = "Link";
$addedresourceid[] = Database::insert_id();
$_SESSION['addedresource'] = $addedresource;
$_SESSION['addedresourceid'] = $addedresourceid;
} else {
// do not add external link to the links table
$addedresource[] = "Externallink";
$addedresourceid[] = $external_link;
$_SESSION['addedresource'] = $addedresource;
$_SESSION['addedresourceid'] = $addedresourceid;
}
$sql = "INSERT INTO $link_table (url, title, category_id) VALUES ('$external_link','$external_link','$add_2_links')";
$result = Database::query($sql);
$addedresource[] = "Link";
$addedresourceid[] = Database::insert_id();
$_SESSION['addedresource'] = $addedresource;
$_SESSION['addedresourceid'] = $addedresourceid;
}
else
{
// do not add external link to the links table
$addedresource[] = "Externallink";
$addedresourceid[] = $external_link;
$_SESSION['addedresource'] = $addedresource;
$_SESSION['addedresourceid'] = $addedresourceid;
}
}
}
@ -201,11 +167,9 @@ $addedresource = $_SESSION['addedresource'];
$addedresourceid = $_SESSION['addedresourceid'];
// This is when a resource was added to the session
if ($add)
{
if ($add) {
// adding the new variable to the local array
if (empty ($_POST['external_link_submit']))
{
if (empty ($_POST['external_link_submit'])) {
//that case is already arranged, see upwards
$addedresource[] = $content;
$addedresourceid[] = $add;

@ -1,42 +1,43 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Defines the scorm class, which is meant to contain the scorm items (nuclear elements)
* @package dokeos.learnpath.scorm
* @package chamilo.learnpath.scorm
* @author Yannick Warnier <ywarnier@beeznest.org>
*/
/**
* Defines the "scorm" child of class "learnpath"
* @package chamilo.learnpath
* Includes
*/
require_once 'scormItem.class.php';
require_once 'scormMetadata.class.php';
require_once 'scormOrganization.class.php';
require_once 'scormResource.class.php';
/**
* Defines the "scorm" child of class "learnpath"
* @package chamilo.learnpath
*/
class scorm extends learnpath {
var $manifest = array();
var $resources = array();
var $resources_att = array();
var $organizations = array();
var $organizations_att = array();
var $metadata = array();
var $idrefs = array(); //will hold the references to resources for each item ID found
var $refurls = array(); //for each resource found, stores the file url/uri
var $subdir = ''; //path between the scorm/ directory and the imsmanifest.xml e.g. maritime_nav/maritime_nav. This is the path that will be used in the lp_path when importing a package
var $items = array();
var $zipname = ''; //keeps the zipfile safe for the object's life so that we can use it if no title avail
var $lastzipnameindex = 0; //keeps an index of the number of uses of the zipname so far
var $manifest_encoding = 'UTF-8';
var $debug = 0;
public $manifest = array();
public $resources = array();
public $resources_att = array();
public $organizations = array();
public $organizations_att = array();
public $metadata = array();
public $idrefs = array(); //will hold the references to resources for each item ID found
public $refurls = array(); //for each resource found, stores the file url/uri
public $subdir = ''; //path between the scorm/ directory and the imsmanifest.xml e.g. maritime_nav/maritime_nav. This is the path that will be used in the lp_path when importing a package
public $items = array();
public $zipname = ''; //keeps the zipfile safe for the object's life so that we can use it if no title avail
public $lastzipnameindex = 0; //keeps an index of the number of uses of the zipname so far
public $manifest_encoding = 'UTF-8';
public $debug = 0;
/**
* Class constructor. Based on the parent constructor.
* @param string Course code
* @param integer Learnpath ID in DB
* @param integer User ID
*/
function scorm($course_code=null,$resource_id=null,$user_id=null) {
function __construct($course_code=null,$resource_id=null,$user_id=null) {
if($this->debug>0){error_log('New LP - scorm::scorm('.$course_code.','.$resource_id.','.$user_id.') - In scorm constructor',0);}
if(!empty($course_code) and !empty($resource_id) and !empty($user_id))
{

@ -1,36 +1,14 @@
<?php //$id:$
//TODO migrate this into the scorm.class.php file
/*
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2004 Dokeos S.A.
Copyright (c) 2004 Denes Nagy
Copyright (c) 2003 Ghent University (UGent)
Copyright (c) 2001 Universite catholique de Louvain (UCL)
For a full list of contributors, see "credits.txt".
The full license can be read in "license.txt".
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 the GNU General Public License for more details.
Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium,
info@dokeos.com
=============================================================================
*/
/* For licensing terms, see /license.txt */
/**
=============================================================================
* This file is a container for functions related to SCORM and other
* standard or common course content types. It might later become a class
* instead of a functions library, as several components are likely to be
* re-used for different content types.
* @package dokeos.learnpath.scorm
* @package chamilo.learnpath.scorm
* @author Yannick Warnier <ywarnier@beeznest.org>
* @author Based on work from Denes NAgy, Isthvan Mandak and Roan Embrechts
=============================================================================
*/
/**
* Delete a scorm directory (check for imsmanifest and if found, deletes the related rows in scorm tables also)

@ -1,7 +1,8 @@
<?php //$id:$
<?php
/* For licensing terms, see /license.txt */
/**
* Container for the scormItem class that deals with <item> elements in an imsmanifest file
* @package dokeos.learnpath.scorm
* @package chamilo.learnpath.scorm
* @author Yannick Warnier <ywarnier@beeznest.org>
*/
/**
@ -9,22 +10,22 @@
*/
require_once 'learnpathItem.class.php';
class scormItem extends learnpathItem{
var $identifier = '';
var $identifierref = '';
var $isvisible = '';
var $parameters = '';
var $title = '';
var $sub_items = array();
var $metadata;
//var $prerequisites = ''; - defined in learnpathItem.class.php
public $identifier = '';
public $identifierref = '';
public $isvisible = '';
public $parameters = '';
public $title = '';
public $sub_items = array();
public $metadata;
//public $prerequisites = ''; - defined in learnpathItem.class.php
// Modified by Ivan Tcholakov, 06-FEB-2010.
//var $max_time_allowed = ''; //should be something like HHHH:MM:SS.SS
var $max_time_allowed = '00:00:00';
//public $max_time_allowed = ''; //should be something like HHHH:MM:SS.SS
public $max_time_allowed = '00:00:00';
//
var $timelimitaction = '';
var $datafromlms = '';
var $mastery_score = '';
var $scorm_contact;
public $timelimitaction = '';
public $datafromlms = '';
public $mastery_score = '';
public $scorm_contact;
/**
* Class constructor. Depending of the type of construction called ('db' or 'manifest'), will create a scormItem
@ -32,7 +33,7 @@ class scormItem extends learnpathItem{
* @param string Type of construction needed ('db' or 'manifest', default = 'manifest')
* @param mixed Depending on the type given, DB id for the lp_item or reference to the DOM element
*/
function scormItem($type='manifest',&$element) {
public function __construct($type='manifest',&$element) {
if(isset($element))
{
@ -267,8 +268,7 @@ class scormItem extends learnpathItem{
* @param integer Optional relative order of the item at this level
* @param integer Optional level. If not given, assumes it's level 0
*/
function get_flat_list(&$list,&$abs_order,$rel_order=1,$level=0)
{
public function get_flat_list(&$list,&$abs_order,$rel_order=1,$level=0) {
$list[] = array(
'abs_order' => $abs_order,
'datafromlms' => $this->datafromlms,
@ -299,8 +299,7 @@ class scormItem extends learnpathItem{
* Save function. Uses the parent save function and adds a layer for SCORM.
* @param boolean Save from URL params (1) or from object attributes (0)
*/
function save($from_outside=true,$prereqs_complete=false)
{
public function save($from_outside=true,$prereqs_complete=false) {
parent::save($from_outside,$prereqs_complete);
//under certain conditions, the scorm_contact should not be set, because no scorm signal was sent
$this->scorm_contact = true;

@ -1,18 +1,19 @@
<?php //$id:$
<?php
/* For licensing terms, see /license.txt */
/**
* Container for the scormMetadata class, setup to hold information about the <metadata> element in imsmanifest files
* @package dokeos.learnpath.scorm
* @package chamilo.learnpath.scorm
*/
/**
* scormMetadata class, handling each <metadata> element found in an imsmanifest file
*/
class scormMetadata {
var $lom = '';
var $schema = '';
var $schemaversion = '';
var $location = '';
var $text = '';
var $attribs = array();
public $lom = '';
public $schema = '';
public $schemaversion = '';
public $location = '';
public $text = '';
public $attribs = array();
/**
* Class constructor. Works in two different ways defined by the first element, being 'db' or 'manifest'.
@ -23,12 +24,11 @@ class scormMetadata {
* @param mixed Depending on the type, can be the DB ID of the learnpath item or the pointer to the <metadata> element in the imsmanifest.xml file
* @return boolean True on success, false on failure
*/
function scormMetadata($type='manifest', &$element) {
if(isset($element))
{
public function __construct($type='manifest', &$element) {
if (isset($element)) {
$v = substr(phpversion(),0,1);
if($v == 4){
switch($type){
if ($v == 4) {
switch ($type) {
case 'db':
//TODO implement this way of metadata object creation
return false;
@ -36,17 +36,15 @@ class scormMetadata {
case 'manifest': //do the same as the default
//if($first_item->type == XML_ELEMENT_NODE) this is already check prior to the call to this function
$children = $element->children();
foreach($children as $a => $dummy)
{
foreach ($children as $a => $dummy) {
$child =& $children[$a];
switch($child->type)
{
switch ($child->type) {
case XML_ELEMENT_NODE:
//could be 'lom','schema','schemaversion' or 'location'
switch($child->tagname){
switch ($child->tagname) {
case 'lom':
$childchildren = $child->children();
foreach($childchildren as $index => $dummy)
foreach ($childchildren as $index => $dummy)
{
$my_elem = $childchildren[$index];
//there is generally only one child here
@ -56,7 +54,7 @@ class scormMetadata {
break;
case 'schema':
$childchildren = $child->children();
foreach($childchildren as $index => $dummy)
foreach ($childchildren as $index => $dummy)
{
$my_elem = $childchildren[$index];
//there is generally only one child here
@ -66,7 +64,7 @@ class scormMetadata {
break;
case 'schemaversion':
$childchildren = $child->children();
foreach($childchildren as $index => $dummy)
foreach ($childchildren as $index => $dummy)
{
$my_elem = $childchildren[$index];
//there is generally only one child here
@ -76,7 +74,7 @@ class scormMetadata {
break;
case 'location':
$childchildren = $child->children();
foreach($childchildren as $index => $dummy)
foreach ($childchildren as $index => $dummy)
{
$my_elem = $childchildren[$index];
//there is generally only one child here
@ -87,12 +85,11 @@ class scormMetadata {
}
break;
case XML_TEXT_NODE:
if(trim($child->content) != '')
{
if(count($children == 1)){
if(trim($child->content) != '') {
if (count($children == 1)) {
//if this is the only child at this level and it is a content... save differently
$this->text = $child->content;
}else{
} else {
$this->text[$element->tagname] = $child->content;
}
}
@ -101,8 +98,8 @@ class scormMetadata {
}
$attributes = $element->attributes();
//$keep_href = '';
if(is_array($attributes)){
foreach($attributes as $a1 => $dummy)
if (is_array($attributes)) {
foreach ($attributes as $a1 => $dummy)
{
$attrib =& $attributes[$a1];
if(trim($attrib->value) != ''){
@ -113,25 +110,25 @@ class scormMetadata {
return true;
//break;
}
}elseif($v == 5){
} elseif ($v == 5) {
//parsing using PHP5 DOMXML methods
switch($type){
switch ($type) {
case 'db':
//TODO implement this way of metadata object creation
return false;
//break;
case 'manifest': //do the same as the default
$children = $element->childNodes;
foreach($children as $child)
foreach ($children as $child)
{
switch($child->nodeType)
switch ($child->nodeType)
{
case XML_ELEMENT_NODE:
//could be 'lom','schema','schemaversion' or 'location'
switch($child->tagName){
switch ($child->tagName) {
case 'lom':
$childchildren = $child->childNodes;
foreach($childchildren as $childchild)
foreach ($childchildren as $childchild)
{
//$this->lom = $childchild->textContent;
$this->lom = $childchild->nodeValue;
@ -139,7 +136,7 @@ class scormMetadata {
break;
case 'schema':
$childchildren = $child->childNodes;
foreach($childchildren as $childchild)
foreach ($childchildren as $childchild)
{
//there is generally only one child here
//$this->schema = $childchildren[$index]->textContent;
@ -148,7 +145,7 @@ class scormMetadata {
break;
case 'schemaversion':
$childchildren = $child->childNodes;
foreach($childchildren as $childchild)
foreach ($childchildren as $childchild)
{
//there is generally only one child here
//$this->schemaversion = $childchildren[$index]->textContent;
@ -157,7 +154,7 @@ class scormMetadata {
break;
case 'location':
$childchildren = $child->childNodes;
foreach($childchildren as $childchild)
foreach ($childchildren as $childchild)
{
//there is generally only one child here
//$this->location = $childchildren[$index]->textContent;
@ -167,12 +164,11 @@ class scormMetadata {
}
break;
case XML_TEXT_NODE:
if(trim($child->textContent) != '')
{
if(count($children == 1)){
if (trim($child->textContent) != '') {
if (count($children == 1)){
//if this is the only child at this level and it is a content... save differently
$this->text = $child->textContent;
}else{
} else {
$this->text[$element->tagName] = $child->textContent;
}
}
@ -181,7 +177,7 @@ class scormMetadata {
}
$attributes = $element->attributes;
//$keep_href = '';
if(is_array($attributes)){
if (is_array($attributes)) {
foreach($attributes as $attrib)
{
if(trim($attrib->value) != ''){
@ -192,7 +188,7 @@ class scormMetadata {
return true;
//break;
}
}else{
} else {
//cannot parse because not PHP4 nor PHP5... We should not even be here anyway...
return false;
}

@ -1,30 +1,30 @@
<?php //$id:$
<?php
/* For licensing terms, see /license.txt */
/**
* Container for the scormOrganization class
* @package dokeos.learnpath.scorm
* @package chamilo.learnpath.scorm
* @author Yannick Warnier <ywarnier@beeznest.org>
*/
/**
* Class defining the <organization> tag in an imsmanifest.xml file
*/
class scormOrganization {
var $identifier = '';
var $structure = '';
var $title = '';
var $items = array();
var $metadata;
public $identifier = '';
public $structure = '';
public $title = '';
public $items = array();
public $metadata;
/**
* Class constructor. Depending of the type of construction called ('db' or 'manifest'), will create a scormOrganization
* object from database records or from the DOM element given as parameter
* @param string Type of construction needed ('db' or 'manifest', default = 'manifest')
* @param mixed Depending on the type given, DB id for the lp_item or reference to the DOM element
*/
function scormOrganization($type='manifest',&$element,$scorm_charset='UTF-8') {
if(isset($element))
{
public function __construct($type='manifest',&$element,$scorm_charset='UTF-8') {
if (isset($element)) {
$v = substr(phpversion(),0,1);
if($v == 4){
switch($type){
if ($v == 4) {
switch ($type) {
case 'db':
//TODO implement this way of metadata object creation
return false;
@ -32,16 +32,14 @@ class scormOrganization {
default:
//if($first_item->type == XML_ELEMENT_NODE) this is already check prior to the call to this function
$children = $element->children();
foreach($children as $a => $dummy)
{
foreach ($children as $a => $dummy) {
$child =& $children[$a];
switch($child->type)
{
switch ($child->type) {
case XML_ELEMENT_NODE:
switch($child->tagname){
switch ($child->tagname) {
case 'item':
$oItem = new scormItem('manifest',$child);
if($oItem->identifier != ''){
if ($oItem->identifier != '') {
$this->items[$oItem->identifier] = $oItem;
}
break;
@ -50,8 +48,7 @@ class scormOrganization {
break;
case 'title':
$tmp_children = $child->children();
if(count($tmp_children)==1 and $tmp_children[0]->content!='' )
{
if (count($tmp_children)==1 and $tmp_children[0]->content!='' ) {
$this->title = $tmp_children[0]->content;
}
break;
@ -63,10 +60,9 @@ class scormOrganization {
}
$attributes = $element->attributes();
//$keep_href = '';
foreach($attributes as $a1 => $dummy)
{
foreach ($attributes as $a1 => $dummy) {
$attrib =& $attributes[$a1];
switch($attrib->name){
switch ($attrib->name) {
case 'identifier':
$this->identifier = $attrib->value;
break;
@ -78,7 +74,7 @@ class scormOrganization {
return true;
}
}elseif($v == 5){
} elseif ($v == 5) {
//parsing using PHP5 DOMXML methods
switch($type){
case 'db':
@ -88,12 +84,10 @@ class scormOrganization {
default:
//if($first_item->type == XML_ELEMENT_NODE) this is already check prior to the call to this function
$children = $element->childNodes;
foreach($children as $child)
{
switch($child->nodeType)
{
foreach ($children as $child) {
switch ($child->nodeType) {
case XML_ELEMENT_NODE:
switch($child->tagName){
switch ($child->tagName) {
case 'item':
$oItem = new scormItem('manifest',$child);
if($oItem->identifier != ''){
@ -105,8 +99,7 @@ class scormOrganization {
break;
case 'title':
$tmp_children = $child->childNodes;
if($tmp_children->length==1 and $child->firstChild->nodeValue != '' )
{
if ($tmp_children->length==1 and $child->firstChild->nodeValue != '' ) {
$this->title = html_entity_decode(html_entity_decode($child->firstChild->nodeValue,ENT_QUOTES,$scorm_charset));
}
break;
@ -116,12 +109,11 @@ class scormOrganization {
break;
}
}
if($element->hasAttributes()){
if ($element->hasAttributes()) {
$attributes = $element->attributes;
//$keep_href = '';
foreach($attributes as $attrib)
{
switch($attrib->name){
foreach ($attributes as $attrib) {
switch ($attrib->name) {
case 'identifier':
$this->identifier = $attrib->value;
break;
@ -134,7 +126,7 @@ class scormOrganization {
return true;
}
}else{
} else {
//cannot parse because not PHP4 nor PHP5... We should not even be here anyway...
return false;
}
@ -145,12 +137,10 @@ class scormOrganization {
* Get a flat list of items in the organization
* @return array Array containing an ordered list of all items with their level and all information related to each item
*/
function get_flat_items_list()
{
public function get_flat_items_list() {
$list = array();
$i = 1;
foreach($this->items as $id=>$dummy)
{
foreach ($this->items as $id=>$dummy) {
$abs_order = 0;
$this->items[$id]->get_flat_list($list,$abs_order,$i,0); //passes the array as a pointer so it is modified in $list directly
$i++;
@ -161,11 +151,10 @@ class scormOrganization {
* Name getter
* @return string Name or empty string
*/
function get_name()
{
if(!empty($this->title)){
public function get_name() {
if (!empty($this->title)) {
return Database::escape_string($this->title);
}else{
} else {
return '';
}
}
@ -173,11 +162,10 @@ class scormOrganization {
* Reference identifier getter
* @return string Identifier or empty string
*/
function get_ref()
{
if(!empty($this->identifier)){
public function get_ref() {
if (!empty($this->identifier)) {
return Database::escape_string($this->identifier);
}else{
} else {
return '';
}
}
@ -185,8 +173,8 @@ class scormOrganization {
* Sets the title element
* @param string New title to set
*/
function set_name($title){
if(!empty($title)){
public function set_name($title) {
if (!empty($title)) {
$this->title = Database::escape_string($title);
}
}

@ -1,7 +1,8 @@
<?php //$id:$
<?php
/* For licensing terms, see /license.txt */
/**
* Container for the scormResource class
* @package dokeos.learnpath.scorm
* @package chamilo.learnpath.scorm
* @author Yannick Warnier <ywarnier@beeznest.org>
*/
/**
@ -9,17 +10,17 @@
*
*/
class scormResource {
var $identifier = '';
var $type = 'webcontent';
//var $identifierref = '';
var $scormtype = 'sco'; //fix problems with ENI content where asset is not defined
var $base = '';
var $href = '';
var $metadata;
//var $file_href;
//var $file_metadata;
var $files = array();
var $dependencies = array();
public $identifier = '';
public $type = 'webcontent';
//public $identifierref = '';
public $scormtype = 'sco'; //fix problems with ENI content where asset is not defined
public $base = '';
public $href = '';
public $metadata;
//public $file_href;
//public $file_metadata;
public $files = array();
public $dependencies = array();
/**
* Class constructor. Depending of the type of construction called ('db' or 'manifest'), will create a scormResource
@ -27,7 +28,7 @@ class scormResource {
* @param string Type of construction needed ('db' or 'manifest', default = 'manifest')
* @param mixed Depending on the type given, DB id for the lp_item or reference to the DOM element
*/
function scormResource($type='manifest',&$element) {
public function __construct($type='manifest',&$element) {
/*
echo "<pre>Analysing resource:<br />\n";
var_dump($element);
@ -184,8 +185,7 @@ class scormResource {
* Path getter
* @return string Path for this resource
*/
function get_path()
{
public function get_path() {
if(!empty($this->href))
{
require_once 'learnpath.class.php';
@ -198,8 +198,7 @@ class scormResource {
* Scorm type getter
* @return string generally 'asset' or 'sco' as these are the only two values defined in SCORM 1.2
*/
function get_scorm_type()
{
public function get_scorm_type() {
if(!empty($this->scormtype)){
require_once 'learnpath.class.php';
return learnpath::escape_string($this->scormtype);
@ -207,5 +206,4 @@ class scormResource {
return '';
}
}
}
?>
}

@ -1,36 +1,13 @@
<?php //$id: $
<?php
/* For licensing terms, see /license.txt */
//This file is probably deprecated - 2009-05-14 - ywarnier
/*
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2004 Dokeos S.A.
Copyright (c) 2004 Denes Nagy
Copyright (c) 2003 Ghent University (UGent)
Copyright (c) 2001 Universite catholique de Louvain (UCL)
For a full list of contributors, see "credits.txt".
The full license can be read in "license.txt".
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 the GNU General Public License for more details.
Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com
==============================================================================
*/
/**
==============================================================================
* This script handles SCO administration features
* @package dokeos.learnpath.scorm
* @package chamilo.learnpath.scorm
* @author Denes Nagy, principal author
* @author Isthvan Mandak, several new features
* @author Roan Embrechts, code improvements and refactoring
* @author Yannick Warnier, complete refactoring <ywarnier@beeznest.org>
==============================================================================
*/
/**
* Script init
@ -52,7 +29,7 @@ $is_allowedToEdit = api_is_allowed_to_edit();
* Variables
*/
//escapable integers
if($_REQUEST['id'] != strval(intval($_REQUEST['id']))){$id = $_REQUEST['id'];}else{$id=null;}
if ($_REQUEST['id'] != strval(intval($_REQUEST['id']))) {$id = $_REQUEST['id'];} else {$id=null;}
//imported strings
$path = (!empty($_REQUEST['path'])?$_REQUEST['path']:null);
@ -78,7 +55,7 @@ $is_allowedToUnzip = $is_courseAdmin;
/**
* Main code
*/
switch($action){
switch ($action) {
case 'exportpath':
if(!empty($id)){
$export = exportpath($id);

@ -1,4 +1,4 @@
<?php // $Id: scorm_api.php 21162 2009-06-01 16:18:46Z yannoo $
<?php
/* For licensing terms, see /license.txt */
/**
* API event handler functions for Scorm 1.1 and 1.2 and 1.3

@ -1,9 +1,9 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Admin script for SCORM packages
* @package dokeos.learnpath.scorm
* @package chamilo.learnpath.scorm
*/
/**
* Here comes the script
*/
?>
*/
Loading…
Cancel
Save