Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
921dcdc
4892: PHP Undefined warnings: index_course_tmpl.php:
Oct 11, 2011
6e93430
4892: PHP Undefined warnings: include/vitals.inc.php
Oct 11, 2011
57bdd76
4892: PHP Undefined warnings: themes/default/include/header.tmpl.php
Oct 11, 2011
5bcb825
4892: PHP Undefined warnings: themes/default/include/footer.tmpl.php
Oct 11, 2011
b258f1d
4892: PHP Undefined warnings: include/page_constants.inc.php
Oct 11, 2011
2090bf7
4892: PHP Undefined warnings: include/sidemenus/category.inc.php
Oct 11, 2011
f2163d2
4892: PHP Undefined warnings: include/classes/Utility.class.php
Oct 11, 2011
e4fb61a
4892: PHP Undefined warnings: include/classes/Menu.class.php
Oct 11, 2011
f2875c8
4892: PHP Undefined warnings: home/ims/ims_import.php
Oct 11, 2011
b349164
4892: PHP Strict warnings: include/classes/DAO/DAO.class.php
Oct 11, 2011
72c0c93
4892: PHP Undefined warnings: home/ims/ims_import.php
Oct 11, 2011
f76cfa8
4892: PHP Undefined warnings: include/vitals.inc.php
Oct 11, 2011
bbadc6e
4892: PHP Undefined warnings: home/ims/ims_import.php
Oct 11, 2011
cc1b381
4892: PHP Undefined warnings: index.php: $is_for_category, index "p"
Oct 19, 2011
5bc3cca
4892: Fix errors and warnings in ContentManager.class.php
Oct 20, 2011
65a0081
4892: ContentDAO.isFieldsValid() return value should not be tied to $…
Oct 20, 2011
f25a950
4892: WeblinksParser.parser() should return a result; endElement() do…
Oct 20, 2011
9ed1aa5
4892: header.tmpl.php: ensure 'previous' and 'resume' keys exist in $…
Oct 20, 2011
9cb6bb9
4892: ims_import.php: fix several issues that cause import failures
Oct 20, 2011
28b9907
4892: vitals.inc.php: Fix warnings and errors
Oct 20, 2011
46b0f00
4907: $user_role contains boolean not array when current user is not …
Oct 26, 2011
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 18 additions & 16 deletions home/classes/ContentManager.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,8 @@ function & getContentTestsAssoc($content_id){
WHERE content_id=$content_id) AS ct
LEFT JOIN ".TABLE_PREFIX."tests t ON ct.test_id=t.test_id
ORDER BY t.title";
return $this->dao->execute($sql);
$result = $this->dao->execute($sql);
return $result;
}

function & cleanOutput($value) {
Expand Down Expand Up @@ -574,18 +575,18 @@ function generateSequenceCrumbs($cid) {

$first = $this->getNextContent(0); // get first

if ($_SESSION['prefs']['PREF_NUMBERING'] && $first) {
if (array_key_exists('PREF_NUMBERING', $_SESSION['prefs']) && $_SESSION['prefs']['PREF_NUMBERING'] && $first) {
$first['title'] = $this->getNumbering($first['content_id']).' '.$first['title'];
}
if ($first) {
$first['url'] = $_base_path.'home/course/content.php?_cid='.$first['content_id'];
$sequence_links['first'] = $first;
}

if (!$cid && $_SESSION['s_cid']) {
if (!$cid && array_key_exists('s_cid', $_SESSION) && $_SESSION['s_cid']) {
$resume['title'] = $this->_menu_info[$_SESSION['s_cid']]['title'];

if ($_SESSION['prefs']['PREF_NUMBERING']) {
if (array_key_exists('PREF_NUMBERING', $_SESSION['prefs']) && $_SESSION['prefs']['PREF_NUMBERING']) {
$resume['title'] = $this->getNumbering($_SESSION['s_cid']).' ' . $resume['title'];
}

Expand All @@ -598,7 +599,7 @@ function generateSequenceCrumbs($cid) {
}
$next = $this->getNextContent($cid ? $cid : 0);

if ($_SESSION['prefs']['PREF_NUMBERING']) {
if (array_key_exists('PREF_NUMBERING', $_SESSION['prefs']) && $_SESSION['prefs']['PREF_NUMBERING']) {
$previous['title'] = $this->getNumbering($previous['content_id']).' '.$previous['title'];
$next['title'] = $this->getNumbering($next['content_id']).' '.$next['title'];
}
Expand Down Expand Up @@ -830,9 +831,10 @@ function printMenu($parent_id, $depth, $path, $children, $truncate, $ignore_stat
if (!isset($temp_path)) {
if ($cid) {
$temp_path = $this->getContentPath($cid);
} else {
} elseif (array_key_exists('s_cid', $_SESSION)) {
$temp_path = $this->getContentPath($_SESSION['s_cid']);
}
} else
$temp_path = array();
}

$highlighted = array();
Expand Down Expand Up @@ -869,7 +871,7 @@ function printMenu($parent_id, $depth, $path, $children, $truncate, $ignore_stat

$on = false;

if ( (($_SESSION['s_cid'] != $content['content_id']) || ($_SESSION['s_cid'] != $cid)) && ($content['content_type'] == CONTENT_TYPE_CONTENT || $content['content_type'] == CONTENT_TYPE_WEBLINK))
if ( ((array_key_exists('s_cid', $_SESSION) && $_SESSION['s_cid'] != $content['content_id']) || (array_key_exists('s_cid', $_SESSION) && $_SESSION['s_cid'] != $cid)) && ($content['content_type'] == CONTENT_TYPE_CONTENT || $content['content_type'] == CONTENT_TYPE_WEBLINK))
{ // non-current content nodes with content type "CONTENT_TYPE_CONTENT"
if (isset($highlighted[$content['content_id']])) {
$link .= '<strong>';
Expand All @@ -891,7 +893,7 @@ function printMenu($parent_id, $depth, $path, $children, $truncate, $ignore_stat
// $link .= $img_link . ' <a href="'.$_base_path.url_rewrite($in_link).'" title="';
$link .= $img_link . ' <a href="'.$in_link.'" title="';
$base_title_length = 29;
if ($_SESSION['prefs']['PREF_NUMBERING']) {
if (array_key_exists('PREF_NUMBERING', $_SESSION['prefs']) && $_SESSION['prefs']['PREF_NUMBERING']) {
// $link .= $path.$counter.' ';
$base_title_length = 24;
}
Expand All @@ -907,7 +909,7 @@ function printMenu($parent_id, $depth, $path, $children, $truncate, $ignore_stat
$link .= $content['title'];
else
$link .= '<span class="inlineEdits" id="menu-'.$content['content_id'].'" title="'.$full_title.'">'.
($_SESSION['prefs']['PREF_NUMBERING'] ? $path.$counter.'&nbsp;' : '').
(array_key_exists('PREF_NUMBERING', $_SESSION['prefs']) && $_SESSION['prefs']['PREF_NUMBERING'] ? $path.$counter.'&nbsp;' : '').
$content['title'].'</span>';

$link .= '</a>';
Expand All @@ -923,7 +925,7 @@ function printMenu($parent_id, $depth, $path, $children, $truncate, $ignore_stat
else
{ // current content page & nodes with content type "CONTENT_TYPE_FOLDER"
$base_title_length = 26;
if ($_SESSION['prefs']['PREF_NUMBERING']) {
if (array_key_exists('PREF_NUMBERING', $_SESSION['prefs']) && $_SESSION['prefs']['PREF_NUMBERING']) {
$base_title_length = 21;
}

Expand All @@ -936,15 +938,15 @@ function printMenu($parent_id, $depth, $path, $children, $truncate, $ignore_stat
{ // current content page
$full_title = $content['title'];
$link .= '<a href="'.$_my_uri.'"><img src="'.$_base_path.'images/clr.gif" alt="'._AT('you_are_here').': '.
($_SESSION['prefs']['PREF_NUMBERING'] ? $path.$counter : '').
(array_key_exists('PREF_NUMBERING', $_SESSION['prefs']) && $_SESSION['prefs']['PREF_NUMBERING'] ? $path.$counter : '').
$content['title'].'" height="1" width="1" border="0" /></a><strong style="color:red" title="'.$content['title'].'">'."\n";

if ($truncate && ($strlen($content['title']) > ($base_title_length-$depth*4)) ) {
$content['title'] = htmlspecialchars(rtrim($substr(htmlspecialchars_decode($content['title']), 0, ($base_title_length-$depth*4)-4))).'...';
}
// $content['title'] = htmlspecialchars(rtrim($substr(htmlspecialchars_decode($content['title']), 0, $base_title_length-4))).'...';
$link .= '<a name="menu'.$content['content_id'].'"></a><span class="inlineEdits" id="menu-'.$content['content_id'].'" title="'.$full_title.'">'.
($_SESSION['prefs']['PREF_NUMBERING'] ? $path.$counter.'&nbsp;' : '').
(array_key_exists('PREF_NUMBERING', $_SESSION['prefs']) && $_SESSION['prefs']['PREF_NUMBERING'] ? $path.$counter.'&nbsp;' : '').
$content['title'].'</span></strong>';

// instructors have privilege to delete content
Expand Down Expand Up @@ -973,7 +975,7 @@ function printMenu($parent_id, $depth, $path, $children, $truncate, $ignore_stat
$link .= $content['title'];
else
$link .= '<span class="inlineEdits" id="menu-'.$content['content_id'].'" title="'.$full_title.'">'.
($_SESSION['prefs']['PREF_NUMBERING'] ? $path.$counter.'&nbsp;' : '').
(array_key_exists('PREF_NUMBERING', $_SESSION['prefs']) && $_SESSION['prefs']['PREF_NUMBERING'] ? $path.$counter.'&nbsp;' : '').
$content['title'].'</span>';

if (isset($_current_user) && $_current_user->isAuthor($this->course_id) && !Utility::isMobileTheme()) {
Expand Down Expand Up @@ -1023,7 +1025,7 @@ function printMenu($parent_id, $depth, $path, $children, $truncate, $ignore_stat
$children[$depth] = 1;
}

if ($_SESSION['s_cid'] == $content['content_id']) {
if (array_key_exists('s_cid', $_SESSION) && $_SESSION['s_cid'] == $content['content_id']) {
if (is_array($this->_menu[$content['content_id']])) {
$_SESSION['menu'][$content['content_id']] = 1;
}
Expand Down Expand Up @@ -1289,4 +1291,4 @@ function printActionMenu($menu, $parent_id, $depth, $path, $children, $print_typ
}
}

?>
?>
Loading