예제 #1
0
/**
 * ownCloud - agreedisclaimer
 *
 * This file is licensed under the MIT License. See the COPYING file.
 *
 * @author Josef Meile <*****@*****.**>
 * @copyright Josef Meile 2015
 */
/**
 * Template that will be rendered on the admin page 
 */
use OCA\AgreeDisclaimer\Controller\SettingsController;
use OCA\AgreeDisclaimer\AppInfo\Application;
//Gets the application settings
$appId = Application::APP_ID;
$data = SettingsController::getSettings(true, true);
$adminSettings = $data['adminSettings'];
$txtFileProp = $appId . 'TxtFile';
$txtFile = $adminSettings[$txtFileProp]['value'];
$txtFileContentsProp = $txtFileProp . 'Contents';
$txtFilePathProp = $txtFileProp . 'Path';
if ($adminSettings[$txtFileProp]['file']['error'] === '') {
    //If there isn't any error with the txt file, then its contents will be
    //retreived
    $textAreaContents = $adminSettings[$txtFileProp]['file']['content'];
} else {
    //Otherwise, an error will be displayed
    $textAreaContents = $adminSettings[$txtFileProp]['file']['error'];
}
$pdfFileProp = $appId . 'PdfFile';
$pdfFile = $adminSettings[$pdfFileProp]['value'];