<?php
-
/**
- * @brief: Get info header of the scheme
+ * @copyright Copyright (C) 2010-2022, the Friendica project
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ * Get info header of the scheme
*
* This function parses the header of the schemename.php file for informations like
* Author, Description and Overwrites. Most of the code comes from the Addon::getInfo()
* 'overwrites' => Variables which overwriting custom settings
*/
-use Friendica\Core\PConfig;
use Friendica\DI;
use Friendica\Util\Strings;
$theme = DI::app()->getCurrentTheme();
$themepath = 'view/theme/' . $theme . '/';
if (empty($scheme)) {
- $scheme = PConfig::get(local_user(), 'frio', 'scheme', PConfig::get(local_user(), 'frio', 'schema'));
+ $scheme = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'frio', 'scheme', DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'frio', 'schema', '---'));
}
$scheme = Strings::sanitizeFilePathItem($scheme);
'description' => '',
'author' => [],
'version' => '',
- 'overwrites' => []
+ 'overwrites' => [],
+ 'accented' => false,
];
- if (!is_file($themepath . 'scheme/' . $scheme . '.php')) return $info;
+ if (!is_file($themepath . 'scheme/' . $scheme . '.php')) {
+ return $info;
+ }
$f = file_get_contents($themepath . 'scheme/' . $scheme . '.php');
foreach ($theme_settings as $key => $value) {
$info['overwrites'][$value] = true;
}
+ } elseif ($k == 'accented') {
+ $info['accented'] = $v && $v != 'false' && $v != 'no';
} else {
if (array_key_exists($k, $info)) {
$info[$k] = $v;