diff --git a/functions.php b/functions.php index bde589c40..df8973876 100755 --- a/functions.php +++ b/functions.php @@ -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); diff --git a/website_code/php/display_library.php b/website_code/php/display_library.php index fd22a0610..0cf5b1d7d 100644 --- a/website_code/php/display_library.php +++ b/website_code/php/display_library.php @@ -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; }