Skip to content
Snippets Groups Projects
Commit bdf7e12c authored by Ben Fesili's avatar Ben Fesili
Browse files

Added error message definitions to lang strings file

parent a1a2fa81
No related branches found
No related tags found
No related merge requests found
......@@ -342,7 +342,7 @@ class view_assets {
*/
public function validatecontent() {
if ($this->content === null) {
print_error('invalidhvp');
print_error('invalidhvp', 'mod_hvp');
}
}
......
......@@ -53,7 +53,7 @@ $hvp = $DB->get_record_sql(
array($cm->instance));
if ($hvp === false) {
print_error('invalidhvp');
print_error('invalidhvp', 'mod_hvp');
}
// Redirect to report if a specific user is chosen.
......
......@@ -454,6 +454,10 @@ $string['couldnotreadfilefromzip'] = 'Unable to read file from the package: %fil
$string['couldnotparsejsonfromzip'] = 'Unable to parse JSON from the package: %fileName';
$string['couldnotparsepostdata'] = 'Could not parse post data.';
$string['nombstringexteension'] = 'The mbstring PHP extension is not loaded. H5P needs this to function properly';
$string['invalidhvp'] = 'Invalid H5P activity';
$string['nohubregistration'] = 'Not registered with H5P Hub';
$string['invalidtoken'] = 'H5P has received an invalid token. Refresh the page and try again';
$string['contentnotshared'] = 'H5P activity cannot be shared. Please check your H5P hub registration';
// Messaging api.
$string['messageprovider:confirmation'] = 'Confirmation of your own H5P submissions';
......
......@@ -53,7 +53,7 @@ $hvp = $DB->get_record_sql(
[$id]);
if ($hvp === false) {
print_error('invalidhvp');
print_error('invalidhvp', 'mod_hvp');
}
// Set page properties.
......
......@@ -43,7 +43,7 @@ require_capability('mod/hvp:share', $context);
// Check if Hub registered, if not redirect to hub registration.
if (empty(get_config('mod_hvp', 'site_uuid')) || empty(get_config('mod_hvp', 'hub_secret'))) {
if (!has_capability('mod/hvp:contenthubregistration', \context_system::instance())) {
print_error('nohubregistration');
print_error('nohubregistration', 'mod_hvp');
}
redirect(new moodle_url('/mod/hvp/content_hub_registration.php'));
}
......@@ -60,10 +60,10 @@ if ($action) {
}
$token = required_param('_token', PARAM_RAW);
if (!\H5PCore::validToken('share_' . $id, $token)) {
print_error('invalidtoken');
print_error('invalidtoken', 'mod_hvp');
}
if (empty($content['contentHubId']) || $content['shared'] !== '1') {
print_error('contentnotshared');
print_error('contentnotshared', 'mod_hvp');
}
$core = \mod_hvp\framework::instance();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment