This commit is contained in:
PMKuipers 2024-06-02 23:28:43 +02:00
parent 64c821bbe9
commit 520034bb5f
6 changed files with 13 additions and 83 deletions

View File

@ -48,23 +48,12 @@ if ($CFG->debugdeveloper) {
}
$PAGE->requires->js_call_amd('local_treestudyplan/page-coach', 'init', []);
/**
* Shortcut function to provide translations
* @param mixed $str Translation key
* @param null|string[] $param Parameters to pass to translation
* @param string $plugin Location to search for translation strings
* @return string Translation of key
*/
function t($str, $param = null, $plugin = 'local_treestudyplan') {
print get_string($str, $plugin, $param);
}
print $OUTPUT->header();
$text = (object)[
'studyplan_select' => t("studyplan_select"),
'coacheditmode' => t("coacheditmode"),
'showoverview' => t("showoverview"),
'studyplan_noneselected' => t("studyplan_noneselected"),
'studyplan_select' => get_string("studyplan_select", 'local_treestudyplan'),
'coacheditmode' => get_string("coacheditmode", 'local_treestudyplan'),
'showoverview' => get_string("showoverview", 'local_treestudyplan'),
'studyplan_noneselected' => get_string("studyplan_noneselected", 'local_treestudyplan'),
];
print <<<END

View File

@ -106,23 +106,11 @@ $PAGE->requires->js_call_amd('local_treestudyplan/page-edit-plan', 'init', [$stu
"defaultAggregation" => get_config("local_treestudyplan", "aggregation_mode"),
]]);
/**
* Shortcut function to provide translations
*
* @param mixed $str Translation key
* @param null|string[] $param Parameters to pass to translation
* @param string $plugin Location to search for translation strings
* @return string Translation of key
*/
function t($str, $param = null, $plugin = 'local_treestudyplan') {
print get_string($str, $plugin, $param);
}
print $OUTPUT->header();
$text = (object)[
'loading' => t("loading", null, "core"),
'studyplan_select' => t("studyplan_select"),
'studyplan_noneselected' => t("studyplan_noneselected"),
'loading' => get_string("loading", "core"),
'studyplan_select' => get_string("studyplan_select", 'local_treestudyplan'),
'studyplan_noneselected' => get_string("studyplan_noneselected", 'local_treestudyplan'),
];
print <<<END

View File

@ -23,17 +23,6 @@
require_once("../../config.php");
// Since this page is externally accessed and validated in a different way, no login is needed.
/**
* Shortcut function to provide translations
*
* @param mixed $str Translation key
* @param null|string[] $param Parameters to pass to translation
* @param string $plugin Location to search for translation strings
* @return string Translation of key
*/
function t($str, $param = null, $plugin = 'local_treestudyplan') {
print get_string($str, $plugin, $param);
}
$systemcontext = context_system::instance();
$PAGE->set_pagelayout('base');

View File

@ -53,18 +53,6 @@ if ($CFG->debugdeveloper) {
}
$PAGE->requires->js_call_amd('local_treestudyplan/page-myreport', 'init', [$amteaching ? 'teaching' : 'own']);
/**
* Shortcut function to provide translations
*
* @param mixed $str Translation key
* @param null|string[] $param Parameters to pass to translation
* @param string $plugin Location to search for translation strings
* @return string Translation of key
*/
function t($str, $param = null, $plugin = 'local_treestudyplan') {
print get_string($str, $plugin, $param);
}
print $OUTPUT->header();
print '<div class="m-buttonbar" style="margin-bottom: 1em; text-align: right;">';

View File

@ -66,18 +66,6 @@ $PAGE->requires->js_call_amd(
[$studyplan->id(), $page->id(), $firstperiod, $lastperiod]
);
/**
* Shortcut function to provide translations
*
* @param mixed $str Translation key
* @param null|string[] $param Parameters to pass to translation
* @param string $plugin Location to search for translation strings
* @return string Translation of key
*/
function t($str, $param = null, $plugin = 'local_treestudyplan') {
print get_string($str, $plugin, $param);
}
print $OUTPUT->header();
print "<h3><b>{$contextname}</b> / {$studyplan->name()}</h3>";
if ($studyplan->name() != $page->fullname()) {

View File

@ -104,26 +104,14 @@ if ($CFG->debugdeveloper) {
}
$PAGE->requires->js_call_amd('local_treestudyplan/page-view-plan', 'init', [$studyplancontext->id, $categoryid]);
/**
* Shortcut function to provide translations
*
* @param mixed $str Translation key
* @param null|string[] $param Parameters to pass to translation
* @param string $plugin Location to search for translation strings
* @return string Translation of key
*/
function t($str, $param = null, $plugin = 'local_treestudyplan') {
print get_string($str, $plugin, $param);
}
print $OUTPUT->header();
$text = (object)[
'loading' => t("loading", null, "core"),
'back' => t('back'),
'studyplan_select' => t("studyplan_select"),
'selectstudent_btn' => t('selectstudent_btn'),
'showoverview' => t("showoverview"),
'studyplan_noneselected' => t("studyplan_noneselected"),
'loading' => get_string("loading", "core"),
'back' => get_string('back', 'local_treestudyplan'),
'studyplan_select' => get_string("studyplan_select", 'local_treestudyplan'),
'selectstudent_btn' => get_string('selectstudent_btn', 'local_treestudyplan'),
'showoverview' => get_string("showoverview", 'local_treestudyplan'),
'studyplan_noneselected' => get_string("studyplan_noneselected", 'local_treestudyplan'),
];
print <<<END
<div id='root'>