forked from seeks/ocDashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.php
35 lines (25 loc) · 1001 Bytes
/
settings.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
\OCP\User::checkLoggedIn();
\OCP\App::checkAppEnabled('ocDashboard');
\OCP\Util::addscript('ocDashboard', 'settings');
OCP\Util::addstyle('ocDashboard', 'ocDashboardSettings');
$user = OCP\User::getUser();
$tmpl = new OCP\Template('ocDashboard', 'settings');
$w = Array();
OC::$CLASSPATH['widgets'] = 'ocDashboard/appinfo/widgetConfigs.php';
OC::$CLASSPATH['factory'] = 'ocDashboard/lib/factory.php';
foreach (widgets::$widgets as $widget) {
$confs = json_decode($widget['conf'], true);
if(isset($confs) && !empty($confs)) {
foreach ($confs as $k => $config) {
if( $config['type'] != 'password') {
$confs[$k]['value'] = OCP\Config::getUserValue($user, "ocDashboard", "ocDashboard_".$widget['id']."_".$config['id'],"");
}
}
}
$enable = OCP\Config::getUserValue($user, "ocDashboard", "ocDashboard_".$widget['id']);
$w[] = Array( "widget" => $widget, "enable" => $enable, "conf" => $confs);
}
//print_r($w);
$tmpl->assign('widgets', $w);
return $tmpl->fetchPage();