Skip to content

Commit

Permalink
Prevent Notices in the PHP error log
Browse files Browse the repository at this point in the history
  • Loading branch information
torinfo committed May 3, 2023
1 parent 1fe9646 commit 77d8800
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
13 changes: 7 additions & 6 deletions functions.php
Expand Up @@ -84,12 +84,13 @@ function _load_language_file($file_path) {
} else {
// this does some magic interrogation of $_SERVER['HTTP_ACCEPT_LANGUAGE'];
//$language = new Zend_Locale();
if (function_exists("locale_accept_from_http")) {
$language = locale_accept_from_http($_SERVER['HTTP_ACCEPT_LANGUAGE']);
}
else{
$lang = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
$language = $lang[0];
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
if (function_exists("locale_accept_from_http")) {
$language = locale_accept_from_http($_SERVER['HTTP_ACCEPT_LANGUAGE']);
} else {
$lang = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
$language = $lang[0];
}
}
// xerte seems to use en-GB instead of the more standard en_GB. Assume this convention will persist....
$language_name = str_replace('_', '-', $language);
Expand Down
16 changes: 14 additions & 2 deletions website_code/php/display_library.php
Expand Up @@ -715,8 +715,20 @@ function get_workspace_contents($folder_id, $tree_id, $sort_type, $copy_only=fal
$titem->xot_type = "file";
$titem->published = $template['access_to_whom'] != 'Private' || $template['tsugi_published'] == 1;
$titem->shared = $template['nrshared'] > 1;
$titem->editor_size = $xerte_toolkits_site->learning_objects->{$template['template_framework'] . "_" . $template['template_name']}->editor_size;
$titem->preview_size = $xerte_toolkits_site->learning_objects->{$template['template_framework'] . "_" . $template['template_name']}->preview_size;
if (isset($xerte_toolkits_site->learning_objects->{$template['template_framework'] . "_" . $template['template_name']}->editor_size)) {
$titem->editor_size = $xerte_toolkits_site->learning_objects->{$template['template_framework'] . "_" . $template['template_name']}->editor_size;
}
else
{
$titem->editor_size="1280, 768";
}
if (isset($xerte_toolkits_site->learning_objects->{$template['template_framework'] . "_" . $template['template_name']}->preview_size)) {
$titem->preview_size = $xerte_toolkits_site->learning_objects->{$template['template_framework'] . "_" . $template['template_name']}->preview_size;
}
else
{
$titem->preview_size="802, 602";
}

$items[] = $titem;
}
Expand Down

0 comments on commit 77d8800

Please sign in to comment.