mirror of
https://github.com/Yetangitu/owncloud-apps.git
synced 2025-10-03 14:59:19 +02:00
Fix deprecated OCP\Config calls
This commit is contained in:
parent
cf484a2ab4
commit
d12f915b51
1 changed files with 4 additions and 4 deletions
|
@ -19,7 +19,7 @@ use \OC\User\User as User;
|
||||||
class Hooks {
|
class Hooks {
|
||||||
|
|
||||||
public static function register() {
|
public static function register() {
|
||||||
Util::connectHook('\OCP\Config', 'js', 'OCA\Files_Reader\Hooks', 'announce_settings');
|
Util::connectHook('js', 'OCA\Files_Reader\Hooks', 'announce_settings');
|
||||||
|
|
||||||
\OC::$server->getRootFolder()->listen('\OC\Files', 'preDelete', function (Node $node) {
|
\OC::$server->getRootFolder()->listen('\OC\Files', 'preDelete', function (Node $node) {
|
||||||
$fileId = $node->getId();
|
$fileId = $node->getId();
|
||||||
|
@ -38,9 +38,9 @@ class Hooks {
|
||||||
// TODO: rmeove this when Owncloud starts encoding oc_appconfig as JSON just like it already encodes most other properties
|
// TODO: rmeove this when Owncloud starts encoding oc_appconfig as JSON just like it already encodes most other properties
|
||||||
$isJson = self::isJson($settings['array']['oc_appconfig']);
|
$isJson = self::isJson($settings['array']['oc_appconfig']);
|
||||||
$array = ($isJson) ? json_decode($settings['array']['oc_appconfig'], true) : $settings['array']['oc_appconfig'];
|
$array = ($isJson) ? json_decode($settings['array']['oc_appconfig'], true) : $settings['array']['oc_appconfig'];
|
||||||
$array['filesReader']['enableEpub'] = Config::get('epub_enable', 'true');
|
$array['filesReader']['enableEpub'] = \OC::$server->getConfig()->getAppValue('epub_enable', 'true');
|
||||||
$array['filesReader']['enablePdf'] = Config::get('pdf_enable', 'true');
|
$array['filesReader']['enablePdf'] = \OC::$server->getConfig()->getAppValue('pdf_enable', 'true');
|
||||||
$array['filesReader']['enableCbx'] = Config::get('cbx_enable', 'true');
|
$array['filesReader']['enableCbx'] = \OC::$server->getConfig()->getAppValue('cbx_enable', 'true');
|
||||||
$settings['array']['oc_appconfig'] = ($isJson) ? json_encode($array) : $array;
|
$settings['array']['oc_appconfig'] = ($isJson) ? json_encode($array) : $array;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue