|
|
|
@ -1474,83 +1474,6 @@ class Display |
|
|
|
|
return $retvalue; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Displays a digest e.g. short summary of new agenda and announcements items. |
|
|
|
|
* This used to be displayed in the right hand menu, but is now |
|
|
|
|
* disabled by default (see config settings in this file) because most people like |
|
|
|
|
* the what's new icons better. |
|
|
|
|
* |
|
|
|
|
* @version 1.0 |
|
|
|
|
*/ |
|
|
|
|
public static function display_digest($toolsList, $digest, $orderKey, $courses) |
|
|
|
|
{ |
|
|
|
|
$html = ''; |
|
|
|
|
if (is_array($digest) && (CONFVAL_showExtractInfo == SCRIPTVAL_UnderCourseList || CONFVAL_showExtractInfo == SCRIPTVAL_Both)) { |
|
|
|
|
// // // LEVEL 1 // // // |
|
|
|
|
reset($digest); |
|
|
|
|
$html .= "<br /><br />\n"; |
|
|
|
|
while (list($key1) = each($digest)) { |
|
|
|
|
if (is_array($digest[$key1])) { |
|
|
|
|
// // // Title of LEVEL 1 // // // |
|
|
|
|
$html .= "<strong>\n"; |
|
|
|
|
if ($orderKey[0] == 'keyTools') { |
|
|
|
|
$tools = $key1; |
|
|
|
|
$html .= $toolsList[$key1]['name']; |
|
|
|
|
} elseif ($orderKey[0] == 'keyCourse') { |
|
|
|
|
$courseSysCode = $key1; |
|
|
|
|
$html .= "<a href=\"".api_get_path(WEB_COURSE_PATH). $courses[$key1]['coursePath']. "\">".$courses[$key1]['courseCode']. "</a>\n"; |
|
|
|
|
} elseif ($orderKey[0] == 'keyTime') { |
|
|
|
|
$html .= api_convert_and_format_date($digest[$key1], DATE_FORMAT_LONG, date_default_timezone_get()); |
|
|
|
|
} |
|
|
|
|
$html .= "</strong>\n"; |
|
|
|
|
// // // End Of Title of LEVEL 1 // // // |
|
|
|
|
// // // LEVEL 2 // // // |
|
|
|
|
reset($digest[$key1]); |
|
|
|
|
while (list ($key2) = each($digest[$key1])) { |
|
|
|
|
// // // Title of LEVEL 2 // // // |
|
|
|
|
$html .= "<p>\n". "\n"; |
|
|
|
|
if ($orderKey[1] == 'keyTools') { |
|
|
|
|
$tools = $key2; |
|
|
|
|
$html .= $toolsList[$key2][name]; |
|
|
|
|
} elseif ($orderKey[1] == 'keyCourse') { |
|
|
|
|
$courseSysCode = $key2; |
|
|
|
|
$html .= "<a href=\"". api_get_path(WEB_COURSE_PATH). $courses[$key2]['coursePath']. "\">". $courses[$key2]['courseCode']. "</a>\n"; |
|
|
|
|
} elseif ($orderKey[1] == 'keyTime') { |
|
|
|
|
$html .= api_convert_and_format_date($key2, DATE_FORMAT_LONG, date_default_timezone_get()); |
|
|
|
|
} |
|
|
|
|
$html .= "\n"; |
|
|
|
|
$html .= "</p>"; |
|
|
|
|
// // // End Of Title of LEVEL 2 // // // |
|
|
|
|
// // // LEVEL 3 // // // |
|
|
|
|
reset($digest[$key1][$key2]); |
|
|
|
|
while (list ($key3, $dataFromCourse) = each($digest[$key1][$key2])) { |
|
|
|
|
// // // Title of LEVEL 3 // // // |
|
|
|
|
if ($orderKey[2] == 'keyTools') { |
|
|
|
|
$level3title = "<a href=\"".$toolsList[$key3]["path"].$courseSysCode."\">".$toolsList[$key3]['name']."</a>"; |
|
|
|
|
} elseif ($orderKey[2] == 'keyCourse') { |
|
|
|
|
$level3title = "• <a href=\"".$toolsList[$tools]["path"].$key3."\">".$courses[$key3]['courseCode']."</a>\n"; |
|
|
|
|
} elseif ($orderKey[2] == 'keyTime') { |
|
|
|
|
$level3title = "• <a href=\"".$toolsList[$tools]["path"].$courseSysCode."\">".api_convert_and_format_date($key3, DATE_FORMAT_LONG, date_default_timezone_get())."</a>"; |
|
|
|
|
} |
|
|
|
|
// // // End Of Title of LEVEL 3 // // // |
|
|
|
|
// // // LEVEL 4 (data) // // // |
|
|
|
|
reset($digest[$key1][$key2][$key3]); |
|
|
|
|
while (list ($key4, $dataFromCourse) = each($digest[$key1][$key2][$key3])) { |
|
|
|
|
$html .= $level3title. ' – '. api_substr(strip_tags($dataFromCourse), 0, CONFVAL_NB_CHAR_FROM_CONTENT); |
|
|
|
|
//adding ... (three dots) if the texts are too large and they are shortened |
|
|
|
|
if (api_strlen($dataFromCourse) >= CONFVAL_NB_CHAR_FROM_CONTENT) { |
|
|
|
|
$html .= '...'; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
$html .= "<br />\n"; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return $html; |
|
|
|
|
} |
|
|
|
|
} // End function display_digest |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Get the session box details as an array |
|
|
|
|
* @param int Session ID |
|
|
|
|