Fixing fatal error due a wrong class name learnpathList changed to LearnpathList

skala
Julio Montoya 12 years ago
parent 01971a0391
commit a43937636d
  1. 2
      main/exercice/exercise.lib.php
  2. 2
      main/exercice/testcategory.class.php
  3. 10
      main/inc/global.inc.php
  4. 39
      main/inc/lib/plugin.lib.php
  5. 4
      main/newscorm/learnpathList.class.php
  6. 2
      main/tracking/course_session_report.php
  7. 4
      main/tracking/lp_results_by_user.php
  8. 3
      main/tracking/question_course_report.php
  9. 2
      vendor/composer/autoload_classmap.php

@ -1239,7 +1239,7 @@ function get_exam_results_data($from, $number_of_items, $column, $direction, $ex
}
}
$lp_list_obj = new learnpathList(api_get_user_id());
$lp_list_obj = new LearnpathList(api_get_user_id());
$lp_list = $lp_list_obj->get_flat_list();
if (is_array($results)) {

@ -877,11 +877,13 @@ class Testcategory
if (!empty($categories)) {
$array = $this->sort_tree_array($categories);
$this->create_tree_array($array);
}
$saved_categories = $exercise_obj->get_categories_in_exercise();
$return = null;
if (!empty($this->category_array_tree)) {
$nbQuestionsTotal = $exercise_obj->getNumberQuestionExerciseCategory();
$original_grouping = $exercise_obj->categories_grouping;

@ -1355,15 +1355,10 @@ $courseAccessConditions = function (Request $request) use ($app) {
*/
if ($courseReset) {
if (!empty($cidReq) && $cidReq != -1) {
$courseInfo = api_get_course_info($cidReq);
if (!empty($courseInfo)) {
//@TODO real_cid should be cid, for working with numeric course id
$_real_cid = $courseInfo['real_id'];
$courseCode = $courseInfo['code'];
$courseId = $courseInfo['real_id'];
@ -1374,13 +1369,16 @@ $courseAccessConditions = function (Request $request) use ($app) {
} else {
$app->abort(404, 'Course not available');
}
} else {
Session::erase('_real_cid');
Session::erase('_cid');
Session::erase('_course');
}
}
$courseCode = api_get_course_id();
if (!empty($courseCode) && $courseCode != -1) {
$time = api_get_utc_datetime();
$tbl_course = Database::get_main_table(TABLE_MAIN_COURSE);
$time = api_get_utc_datetime();
$sql="UPDATE $tbl_course SET last_visit= '$time' WHERE code='$courseCode'";

@ -123,14 +123,14 @@ class AppPlugin
return $this->plugin_regions;
}
function load_region($region, $main_template, $forced = false) {
if ($region == 'course_tool_plugin') {
return null;
function load_region($region, $main_template, $forced = false) {
if ($region == 'course_tool_plugin') {
return null;
}
ob_start();
$this->get_all_plugin_contents_by_region($region, $main_template, $forced);
$content = ob_get_contents();
ob_end_clean();
ob_end_clean();
return $content;
}
@ -145,12 +145,12 @@ class AppPlugin
$root = api_get_path(SYS_PLUGIN_PATH);
//1. Loading english if exists
$english_path = $root.$plugin_name."/lang/english.php";
$english_path = $root.$plugin_name."/lang/english.php";
if (is_readable($english_path)) {
include $english_path;
foreach ($strings as $key => $string) {
foreach ($strings as $key => $string) {
$GLOBALS[$key] = $string;
}
}
@ -162,7 +162,7 @@ class AppPlugin
if (is_readable($path)) {
include $path;
if (!empty($strings)) {
foreach ($strings as $key => $string) {
foreach ($strings as $key => $string) {
$GLOBALS[$key] = $string;
}
}
@ -178,14 +178,14 @@ class AppPlugin
* @todo improve this function
*/
function get_all_plugin_contents_by_region($region, $template, $forced = false) {
global $_plugins;
global $_plugins;
if (isset($_plugins[$region]) && is_array($_plugins[$region])) {
//if (1) {
//if (1) {
//Load the plugin information
foreach ($_plugins[$region] as $plugin_name) {
//The plugin_info variable is available inside the plugin index
$plugin_info = $this->get_plugin_info($plugin_name, $forced);
$plugin_info = $this->get_plugin_info($plugin_name, $forced);
//We also know where the plugin is
$plugin_info['current_region'] = $region;
@ -244,12 +244,12 @@ class AppPlugin
*/
function get_plugin_info($plugin_name, $forced = false) {
static $plugin_data = array();
if (isset($plugin_data[$plugin_name]) && $forced == false) {
return $plugin_data[$plugin_name];
} else {
$plugin_file = api_get_path(SYS_PLUGIN_PATH)."$plugin_name/plugin.php";
$plugin_info = array();
if (file_exists($plugin_file)) {
require $plugin_file;
@ -263,7 +263,7 @@ class AppPlugin
$settings_filtered[$item['variable']] = $item['selected_value'];
}
$plugin_info['settings'] = $settings_filtered;
$plugin_data[$plugin_name] = $plugin_info;
$plugin_data[$plugin_name] = $plugin_info;
return $plugin_info;
}
}
@ -354,6 +354,7 @@ class AppPlugin
function set_course_settings_defaults(& $values) {
$plugin_list = $this->get_installed_plugins();
foreach ($plugin_list as $plugin_name) {
$plugin_info = $this->get_plugin_info($plugin_name);
if (isset($plugin_info['plugin_class'])) {
@ -372,7 +373,7 @@ class AppPlugin
}
}
/**
* When saving the plugin values in the course settings, check whether
* When saving the plugin values in the course settings, check whether
* a callback method should be called and send it the updated settings
* @param array The new settings the user just saved
* @return void
@ -391,7 +392,7 @@ class AppPlugin
}
if ($i>0) {
$plugin_info = $this->get_plugin_info($plugin_name);
if (isset($plugin_info['plugin_class'])) {
$obj = $plugin_info['plugin_class']::create();
$obj->course_settings_updated($subvalues);
@ -399,19 +400,19 @@ class AppPlugin
}
}
}
/**
* Gets a nice array of keys for just the plugin's course settings
* @param string The plugin ID
* @return array Nice array of keys for course settings
*/
*/
public function get_plugin_course_settings($plugin_name) {
$settings = array();
if (empty($plugin_name)) {
return $settings;
}
$plugin_info = $this->get_plugin_info($plugin_name);
if (isset($plugin_info['plugin_class'])) {
$obj = $plugin_info['plugin_class']::create();
if (is_array($obj->course_settings)) {

@ -13,7 +13,9 @@
* @uses Database.lib.php to use the database
* @uses learnpath.class.php to generate learnpath objects to get in the list
*/
class learnpathList {
class LearnpathList
{
public $list = array(); // Holds a flat list of learnpaths data from the database.
public $ref_list = array(); // Holds a list of references to the learnpaths objects (only filled by get_refs()).
public $alpha_list = array(); // Holds a flat list of learnpaths sorted by alphabetical name order.

@ -128,7 +128,7 @@ foreach ($course_list as $current_course ) {
$attempt_result = array();
//Getting LP list
$list = new learnpathList('', $current_course['code'], $session_id);
$list = new LearnpathList('', $current_course['code'], $session_id);
$lp_list = $list->get_flat_list();
// Looping LPs

@ -127,10 +127,8 @@ $user_list = array();
foreach($course_list as $current_course ) {
$course_info = api_get_course_info($current_course['code']);
$_course = $course_info;
//Getting LP list
$list = new learnpathList('', $current_course['code'], $session_id);
$list = new LearnpathList('', $current_course['code'], $session_id);
$lp_list = $list->get_flat_list();
// Looping LPs

@ -15,7 +15,6 @@ require_once api_get_path(SYS_CODE_PATH).'exercice/exercise.class.php';
require_once api_get_path(SYS_CODE_PATH).'exercice/question.class.php';
require_once api_get_path(LIBRARY_PATH).'pear/Spreadsheet_Excel_Writer/Writer.php';
require_once api_get_path(SYS_CODE_PATH).'newscorm/learnpathList.class.php';
require_once api_get_path(SYS_CODE_PATH).'newscorm/learnpath.class.php';
require_once api_get_path(SYS_CODE_PATH).'newscorm/learnpathList.class.php';
@ -88,7 +87,7 @@ $form->setDefaults(array('course_code'=>(string)$course_code));
$course_info = api_get_course_info($course_code);
if (!empty($course_info)) {
$list = new learnpathList('', $course_code);
$list = new LearnpathList('', $course_code);
$lp_list = $list->get_flat_list();
$_course = $course_info;
$main_question_list = array();

@ -700,7 +700,7 @@ return array(
'langstats' => $baseDir . '/main/cron/lang/langstats.class.php',
'learnpath' => $baseDir . '/main/newscorm/learnpath.class.php',
'learnpathItem' => $baseDir . '/main/newscorm/learnpathItem.class.php',
'learnpathList' => $baseDir . '/main/newscorm/learnpathList.class.php',
'LearnpathList' => $baseDir . '/main/newscorm/learnpathList.class.php',
'learnpath_processor' => $baseDir . '/main/inc/lib/search/tool_processors/learnpath_processor.class.php',
'lessc' => $vendorDir . '/leafo/lessphp/lessc.inc.php',
'lessc_formatter_classic' => $vendorDir . '/leafo/lessphp/lessc.inc.php',

Loading…
Cancel
Save