Fixes various Notices in Lessons

1.10.x
José Loguercio 9 years ago
parent 036951c275
commit c9c76e2e46
  1. 25
      main/newscorm/learnpath.class.php

@ -1894,10 +1894,15 @@ class learnpath
if ($this->debug > 0) {
error_log('New LP - In learnpath::get_last()', 0);
}
//This is just in case the lesson doesn't cointain a valid scheme, just to avoid "Notices"
if ($this->index > 0) {
$this->index = count($this->ordered_items) - 1;
return $this->ordered_items[$this->index];
}
return false;
}
/**
* Gets the navigation bar for the learnpath display screen
* @return string The HTML string to use as a navigation bar
@ -5497,7 +5502,7 @@ class learnpath
}
$this->tree_array($arrLP);
$arrLP = $this->arrMenu;
$arrLP = isset($this->arrMenu) ? $this->arrMenu : null;
unset ($this->arrMenu);
$default_data = null;
$default_content = null;
@ -6320,7 +6325,7 @@ class learnpath
}
$this->tree_array($arrLP);
$arrLP = $this->arrMenu;
$arrLP = isset($this->arrMenu) ? $this->arrMenu : null;
unset ($this->arrMenu);
if ($action == 'add') {
@ -6738,7 +6743,7 @@ class learnpath
}
$this->tree_array($arrLP);
$arrLP = $this->arrMenu;
$arrLP = isset($this->arrMenu) ? $this->arrMenu : null;
unset($this->arrMenu);
if ($action == 'add')
@ -6929,7 +6934,7 @@ class learnpath
}
$this->tree_array($arrLP);
$arrLP = $this->arrMenu;
$arrLP = isset($this->arrMenu) ? $this->arrMenu : null;
unset ($this->arrMenu);
$return .= '<form method="POST">';
@ -7372,7 +7377,7 @@ class learnpath
}
$this->tree_array($arrLP);
$arrLP = $this->arrMenu;
$arrLP = isset($this->arrMenu) ? $this->arrMenu : null;
unset ($this->arrMenu);
if ($action == 'add') {
@ -7661,7 +7666,7 @@ class learnpath
}
$this->tree_array($arrLP);
$arrLP = $this->arrMenu;
$arrLP = isset($this->arrMenu) ? $this->arrMenu : null;
unset ($this->arrMenu);
if ($action == 'add')
@ -7854,7 +7859,7 @@ class learnpath
}
$this->tree_array($arrLP);
$arrLP = $this->arrMenu;
$arrLP = isset($this->arrMenu) ? $this->arrMenu : null;
unset ($this->arrMenu);
if ($action == 'add') {
@ -8295,7 +8300,7 @@ class learnpath
}
$this->tree_array($arrLP);
$arrLP = $this->arrMenu;
$arrLP = isset($this->arrMenu) ? $this->arrMenu : null;
unset($this->arrMenu);
for ($i = 0; $i < count($arrLP); $i++) {
@ -10339,7 +10344,9 @@ EOD;
}
$protocolFixApplied = false;
if ($platformProtocol != $urlInfo['scheme']) {
//Scheme validation to avoid "Notices" when the lesson doesn't contain a valid scheme
$scheme = isset($urlInfo['scheme']) ? $urlInfo['scheme'] : null;
if ($platformProtocol != $scheme) {
$_SESSION['x_frame_source'] = $src;
$src = 'blank.php?error=x_frames_options';
$protocolFixApplied = true;

Loading…
Cancel
Save