51 lines
1.6 KiB
Plaintext
51 lines
1.6 KiB
Plaintext
@namespace Oqtane.Modules.HtmlText
|
|
@inherits ModuleBase
|
|
@inject ISettingService SettingService
|
|
@implements Oqtane.Interfaces.ISettingsControl
|
|
@inject IStringLocalizer<Settings> Localizer
|
|
@inject IStringLocalizer<SharedResources> SharedLocalizer
|
|
|
|
<table class="table table-borderless">
|
|
<tr>
|
|
<td width="30%">
|
|
<Label For="files" ResourceKey="Allow File Management" HelpText="Specify If Editors Can Upload and Select Files">Allow File Management: </Label>
|
|
</td>
|
|
<td>
|
|
<select id="files" class="form-select" @bind="@_allowfilemanagement">
|
|
<option value="true">@SharedLocalizer["Yes"]</option>
|
|
<option value="false">@SharedLocalizer["No"]</option>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
@code {
|
|
private string _allowfilemanagement;
|
|
|
|
protected override void OnInitialized()
|
|
{
|
|
try
|
|
{
|
|
_allowfilemanagement = SettingService.GetSetting(ModuleState.Settings, "AllowFileManagement", "true");
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ModuleInstance.AddModuleMessage(ex.Message, MessageType.Error);
|
|
}
|
|
}
|
|
|
|
public async Task UpdateSettings()
|
|
{
|
|
try
|
|
{
|
|
var settings = ModuleState.Settings;
|
|
settings = SettingService.SetSetting(settings, "AllowFileManagement", _allowfilemanagement);
|
|
await SettingService.UpdateModuleSettingsAsync(settings, ModuleState.ModuleId);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ModuleInstance.AddModuleMessage(ex.Message, MessageType.Error);
|
|
}
|
|
}
|
|
}
|