diff --git a/main/newscorm/openoffice_presentation.class.php b/main/newscorm/openoffice_presentation.class.php index 0689421d80..85607a9db8 100644 --- a/main/newscorm/openoffice_presentation.class.php +++ b/main/newscorm/openoffice_presentation.class.php @@ -12,8 +12,11 @@ * @package dokeos.learnpath.openofficedocument */ require_once('openoffice_document.class.php'); -require_once(api_get_path(LIBRARY_PATH).'search/DokeosIndexer.class.php'); -require_once(api_get_path(LIBRARY_PATH).'search/IndexableChunk.class.php'); +if(api_get_setting('search_enabled')==='true') //the true condition here should be if xapian module is installed +{ + require_once(api_get_path(LIBRARY_PATH).'search/DokeosIndexer.class.php'); + require_once(api_get_path(LIBRARY_PATH).'search/IndexableChunk.class.php'); +} class OpenofficePresentation extends OpenofficeDocument { @@ -108,7 +111,7 @@ class OpenofficePresentation extends OpenofficeDocument { } } // code for text indexing - if (isset($_POST['index_document']) && $_POST['index_document']) { + if (isset($_POST['index_document']) && $_POST['index_document'] && api_get_setting('search_enabled')==='true') { //Display::display_normal_message(print_r($_POST)); $di = new DokeosIndexer(); isset($_POST['language'])? $lang=Database::escape_string($_POST['language']): $lang = 'english'; diff --git a/main/upload/upload_ppt.php b/main/upload/upload_ppt.php index 79f692a96f..1eaef7fc39 100644 --- a/main/upload/upload_ppt.php +++ b/main/upload/upload_ppt.php @@ -164,7 +164,7 @@ $renderer->setElementTemplate($user_file_template); $form -> addElement ('file', 'user_file','  '); $form -> addElement ('checkbox', 'take_slide_name','', get_lang('TakeSlideName')); -if(api_get_setting('search_enabled')=='true') +if(api_get_setting('search_enabled')==='true') { $form -> addElement ('checkbox', 'index_document','', get_lang('SearchFeatureDoIndexDocument')); $form -> addElement ('text', 'terms', get_lang('SearchFeatureDocumentTagsIfIndexing').': ');