/**
  * Get the file information for the txt and pdf files
  *
  * @param   bool    $isAdminForm    Whether or not is called from the admin
  *          form. This is used because the method can be also called from
  *          the login page. Here the differences:
  *          - When called from the admin form, no fall back languages will
  *            be used 
  *          - When called from the login form, fall back languages will be
  *            used 
  * @param   string  $defaultLang    Default language for which the file will
  *          be recovered in case that it doesn't exist for the current
  *          language. In case that it is null, then the default language of
  *          the application will be used.
  *
  * @return array   Array with the file information for the txt and pdf
  *         files. It has this format:
  *          [
  *              '<appId>TxtFile'        => [
  *                  'value'    => <true_or_false>,
  *                  'basePath' => <absolute_path_of_txt_file>,
  *                  'file'     => [
  *                      'exists'  => <does_the_file_exist>,
  *                      'lang'    => <file_language_code>,
  *                      'name'    => <file_name>,
  *                      'path'    => <file_location_in_the_file_system>,
  *                      'url'     => <url_to_file_in_web_browser>,
  *                      'content' => <contents_txt_file>,
  *                      'error'   => <error_message>,
  *                  ],
  *              ],
  *              '<appId>PdfFile'        => [
  *                  'value'    => <true_or_false>,
  *                  'basePath' => <absolute_path_of_pdf_file>,
  *                  'file'     => [
  *                      'exists'  => <does_the_file_exist>,
  *                      'lang'    => <file_language_code>,
  *                      'name'    => <file_name>,
  *                      'path'    => <file_location_in_the_file_system>,
  *                      'url'     => <url_to_file_in_web_browser>,
  *                      'error'   => <error_message>,
  *                  ],
  *              ]
  *          ]
  */
 function getFiles($isAdminForm = false, $defaultLang = null)
 {
     $data = array();
     $appId = Application::APP_ID;
     $appConfig = \OC::$server->getAppConfig();
     if ($defaultLang === null) {
         $defaultLangProp = $appId . 'DefaultLang';
         $defaultLang = self::getSetting($defaultLangProp, 'en', $appConfig);
     }
     if (!$isAdminForm) {
         $userLang = Utils::getUserLang();
         $getFallbackLang = true;
     } else {
         $userLang = $defaultLang;
         $getFallbackLang = false;
     }
     $maxTxtFileSizeProp = $appId . 'MaxTxtFileSize';
     $maxTxtFileSize = self::getSetting($maxTxtFileSizeProp, '1', $appConfig);
     $txtFileBasePath = Application::getTxtFilesPath();
     $pdfFileBasePath = Application::getPdfFilesPath();
     $fileInfo = self::getFile($userLang, $defaultLang, $txtFileBasePath, 'txt', true, $maxTxtFileSize, $getFallbackLang);
     $data['txtFile'] = $fileInfo;
     $fileInfo = self::getFile($userLang, $defaultLang, $pdfFileBasePath, 'pdf', false, 2, $getFallbackLang);
     $data['pdfFile'] = $fileInfo;
     return $data;
 }