コード例 #1
0
                http_put_data($URI, $newUserSettings, true, $message);
                if ($message == "201") {
                    $notifications[] = MakeNotification("success", Language::Get('main', 'languageChanged', $langTemplate));
                }
            } else {
                $notifications = $notifications + $f->notifications;
            }
        }
    }
}
// load user data from the database
$databaseURI = $getSiteURI . "/accountsettings/user/{$uid}";
$accountSettings_data = http_get($databaseURI, true);
$accountSettings_data = json_decode($accountSettings_data, true);
// construct a new header
$h = Template::WithTemplateFile('include/Header/Header.template.html');
$h->bind($accountSettings_data);
$h->bind(array("name" => Language::Get('main', 'accountSettings', $langTemplate), "backTitle" => Language::Get('main', 'course', $langTemplate), "backURL" => "index.php", "notificationElements" => $notifications));
// construct a content element for account information
$accountInfo = Template::WithTemplateFile('include/AccountSettings/AccountInfo.template.html');
$accountInfo->bind($accountSettings_data);
// construct a content element for changing password
$changePassword = Template::WithTemplateFile('include/AccountSettings/ChangePassword.template.html');
$changePassword->bind($accountSettings_data);
// wrap all the elements in some HTML and show them on the page
$w = new HTMLWrapper($h, $accountInfo, $changePassword);
$w->defineForm(basename(__FILE__), false, $changePassword);
$w->defineForm(basename(__FILE__), false, $accountInfo);
$w->set_config_file('include/configs/config_default.json');
$w->show();