Compare commits
4 Commits
feature/co
...
464f229a16
Author | SHA1 | Date | |
---|---|---|---|
|
464f229a16 | ||
|
fe72097d75 | ||
|
98efb779b1 | ||
30045b9f65 |
@@ -33,4 +33,8 @@ class OpenWeatherMap extends VirtualDeviceManager
|
|||||||
return 'exception: ' . $e->getMessage();
|
return 'exception: ' . $e->getMessage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function enable(){
|
||||||
|
(new SettingsManager)->create('open_weather_api_token', '', 'open_weather');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -70,6 +70,8 @@ class Setting extends Template
|
|||||||
$result = $settingsManager->getSettingGroup($plugins[$key]['slug']);
|
$result = $settingsManager->getSettingGroup($plugins[$key]['slug']);
|
||||||
if (count ($result) > 0) {
|
if (count ($result) > 0) {
|
||||||
$plugins[$key]['settings'] = $result;
|
$plugins[$key]['settings'] = $result;
|
||||||
|
} else {
|
||||||
|
unset($plugins[$key]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -202,7 +202,23 @@ $partial = new Partial('head');
|
|||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!--Plugins Settings-->
|
||||||
|
<?php foreach ($PLUGINSSETTINGS as $key => $pluginSeting) { ?>
|
||||||
|
<div class="col-12 col-sm-9 mx-auto mt-4">
|
||||||
|
<h4 class="mb-4"><?php echo $pluginSeting['name'] ?></h4>
|
||||||
|
<form method="post">
|
||||||
|
<?php foreach ($pluginSeting['settings'] as $key => $pluginSetingField) { ?>
|
||||||
|
<div class="field">
|
||||||
|
<div class="label"><?php echo $pluginSetingField['name'] ?>:</div>
|
||||||
|
<input type="text" class="input" name="roomName" value="<?php echo $pluginSetingField['value'] ?>">
|
||||||
|
</div>
|
||||||
|
<?php } ?>
|
||||||
|
<div class="field">
|
||||||
|
<input type="submit" name="submitPlugins<?php echo $pluginSeting['name'] ?>Settings" class="button" value="<?php $LANGMNG->echo('b_save') ?>">
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<?php } ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,24 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace Core\Configuration;
|
|
||||||
|
|
||||||
class ConfigurationLoader
|
|
||||||
{
|
|
||||||
private const CONFIGURATIONS_DIRECTORY = __DIR__ . DIRECTORY_SEPARATOR
|
|
||||||
. '..' . DIRECTORY_SEPARATOR
|
|
||||||
. '..' . DIRECTORY_SEPARATOR . 'config'
|
|
||||||
. DIRECTORY_SEPARATOR;
|
|
||||||
|
|
||||||
public function load(): array
|
|
||||||
{
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Concerns
|
|
||||||
* -> Loading configuration files
|
|
||||||
* - Scan directory for files.
|
|
||||||
* - Filtering none config / php files.
|
|
||||||
* - Creating assoc array.
|
|
||||||
*/
|
|
||||||
}
|
|
@@ -8,18 +8,4 @@ namespace Core\Configuration;
|
|||||||
* @author Romano Schoonheim https://github.com/romano1996
|
* @author Romano Schoonheim https://github.com/romano1996
|
||||||
*/
|
*/
|
||||||
class Configurations
|
class Configurations
|
||||||
{
|
{}
|
||||||
/** @var array */
|
|
||||||
private $configurations;
|
|
||||||
|
|
||||||
public function __construct(ConfigurationLoader $configurationLoader)
|
|
||||||
{
|
|
||||||
// Concern: Storing assoc array to this object.
|
|
||||||
$this->configurations = $configurationLoader->load();
|
|
||||||
}
|
|
||||||
|
|
||||||
public function get(string $path)
|
|
||||||
{
|
|
||||||
// Concern: Accessing configurations based on "paths" application.something For example.
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
Reference in New Issue
Block a user