2020-04-21 20:37:42 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
2020-04-21 21:15:33 +00:00
|
|
|
* ownCloud - Epubreader App
|
2020-04-21 20:37:42 +00:00
|
|
|
*
|
|
|
|
* @author Frank de Lange
|
|
|
|
* @copyright 2014,2018 Frank de Lange
|
|
|
|
*
|
|
|
|
* This file is licensed under the Affero General Public License version 3 or
|
|
|
|
* later.
|
|
|
|
*/
|
|
|
|
|
2020-04-21 21:15:33 +00:00
|
|
|
namespace OCA\Epubreader;
|
2020-04-21 20:37:42 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Config class for Reader
|
|
|
|
*/
|
|
|
|
class Config
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @brief get user config value
|
|
|
|
*
|
|
|
|
* @param string $key value to retrieve
|
|
|
|
* @param string $default default value to use
|
|
|
|
* @return string retrieved value or default
|
|
|
|
*/
|
|
|
|
public static function get($key, $default) {
|
2020-04-21 21:15:33 +00:00
|
|
|
return \OC::$server->getConfig()->getUserValue(\OCP\User::getUser(), 'epubreader', $key, $default);
|
2020-04-21 20:37:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief set user config value
|
|
|
|
*
|
|
|
|
* @param string $key key for value to change
|
|
|
|
* @param string $value value to use
|
|
|
|
* @return bool success
|
|
|
|
*/
|
|
|
|
public static function set($key, $value) {
|
2020-04-21 21:15:33 +00:00
|
|
|
return \OC::$server->getConfig()->setUserValue(\OCP\User::getUser(), 'epubreader', $key, $value);
|
2020-04-21 20:37:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief get app config value
|
|
|
|
*
|
|
|
|
* @param string $key value to retrieve
|
|
|
|
* @param string $default default value to use
|
|
|
|
* @return string retrieved value or default
|
|
|
|
*/
|
|
|
|
public static function getApp($key, $default) {
|
2020-04-21 21:15:33 +00:00
|
|
|
return \OC::$server->getConfig()->getAppValue('epubreader', $key, $default);
|
2020-04-21 20:37:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief set app config value
|
|
|
|
*
|
|
|
|
* @param string $key key for value to change
|
|
|
|
* @param string $value value to use
|
|
|
|
* @return bool success
|
|
|
|
*/
|
|
|
|
public static function setApp($key, $value) {
|
2020-04-21 21:15:33 +00:00
|
|
|
return \OC::$server->getConfig()->setAppValue('epubreader', $key, $value);
|
2020-04-21 20:37:42 +00:00
|
|
|
}
|
|
|
|
}
|