Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): Failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in /home/monara/public_html/test.athavaneng.com/themes.php on line 99
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 226
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 227
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 228
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 229
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 230
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 231
.
/**
* Report plugins helper class
*
* @package core
* @subpackage report
* @copyright 2021 Sujith Haridasan
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core;
use moodle_url;
use url_select;
/**
* A helper class with static methods to help report plugins
*
* @package core
* @copyright 2021 Sujith Haridasan
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class report_helper {
/**
* Print the selector dropdown
*
* @param string $pluginname The report plugin where the header is modified
* @return void
*/
public static function print_report_selector(string $pluginname):void {
global $OUTPUT, $PAGE;
if ($reportnode = $PAGE->settingsnav->find('coursereports', \navigation_node::TYPE_CONTAINER)) {
$menuarray = \core\navigation\views\secondary::create_menu_element([$reportnode]);
if (empty($menuarray)) {
return;
}
$coursereports = get_string('reports');
$activeurl = '';
if (isset($menuarray[0])) {
// Remove the reports entry.
$result = array_search($coursereports, $menuarray[0][$coursereports]);
unset($menuarray[0][$coursereports][$result]);
// Find the active node.
foreach ($menuarray[0] as $key => $value) {
$check = array_search($pluginname, $value);
if ($check !== false) {
$activeurl = $check;
}
}
} else {
$result = array_search($coursereports, $menuarray);
unset($menuarray[$result]);
$check = array_search($pluginname, $menuarray);
if ($check !== false) {
$activeurl = $check;
}
}
$select = new url_select($menuarray, $activeurl, null, 'choosecoursereport');
$select->set_label(get_string('reporttype'), ['class' => 'accesshide']);
echo \html_writer::tag('div', $OUTPUT->render($select), ['class' => 'tertiary-navigation']);
}
echo $OUTPUT->heading($pluginname, 2, 'mb-3');
}
/**
* Save the last selected report in the session
*
* @deprecated since Moodle 4.0
* @param int $id The course id
* @param moodle_url $url The moodle url
* @return void
*/
public static function save_selected_report(int $id, moodle_url $url):void {
global $USER;
debugging('save_selected_report() has been deprecated because it is no longer used and will be '.
'removed in future versions of Moodle', DEBUG_DEVELOPER);
// Last selected report.
if (!isset($USER->course_last_report)) {
$USER->course_last_report = [];
}
$USER->course_last_report[$id] = $url;
}
}