mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2025-06-07 09:54:27 +02:00
[various] Convert addon_settings hook functions to the new data array format
- Add separate template files to several addons - Remove superfluous addon settings CSS files
This commit is contained in:
parent
f0522a998b
commit
779b38ec09
68 changed files with 444 additions and 953 deletions
|
@ -17,7 +17,7 @@ function markdown_install() {
|
|||
Hook::register('addon_settings_post', __FILE__, 'markdown_addon_settings_post');
|
||||
}
|
||||
|
||||
function markdown_addon_settings(App $a, &$s)
|
||||
function markdown_addon_settings(App $a, array &$data)
|
||||
{
|
||||
if (!local_user()) {
|
||||
return;
|
||||
|
@ -25,12 +25,16 @@ function markdown_addon_settings(App $a, &$s)
|
|||
|
||||
$enabled = intval(DI::pConfig()->get(local_user(), 'markdown', 'enabled'));
|
||||
|
||||
$t = Renderer::getMarkupTemplate('settings.tpl', 'addon/markdown/');
|
||||
$s .= Renderer::replaceMacros($t, [
|
||||
'$title' => DI::l10n()->t('Markdown'),
|
||||
'$enabled' => ['enabled', DI::l10n()->t('Enable Markdown parsing'), $enabled, DI::l10n()->t('If enabled, self created items will additionally be parsed via Markdown.')],
|
||||
'$submit' => DI::l10n()->t('Save Settings'),
|
||||
$t = Renderer::getMarkupTemplate('settings.tpl', 'addon/markdown/');
|
||||
$html = Renderer::replaceMacros($t, [
|
||||
'$enabled' => ['enabled', DI::l10n()->t('Enable Markdown parsing'), $enabled, DI::l10n()->t('If enabled, adds Markdown support to the Compose Post form.')],
|
||||
]);
|
||||
|
||||
$data = [
|
||||
'addon' => 'markdown',
|
||||
'title' => DI::l10n()->t('Markdown Settings'),
|
||||
'html' => $html,
|
||||
];
|
||||
}
|
||||
|
||||
function markdown_addon_settings_post(App $a, &$b)
|
||||
|
|
|
@ -1,15 +1 @@
|
|||
<span id="settings_markdown_inflated" class="settings-block fakelink" style="display: block;" onclick="openClose('settings_markdown_expanded'); openClose('settings_markdown_inflated');">
|
||||
<h3>{{$title}}</h3>
|
||||
</span>
|
||||
<div id="settings_markdown_expanded" class="settings-block" style="display: none;">
|
||||
<span class="fakelink" onclick="openClose('settings_markdown_expanded'); openClose('settings_markdown_inflated');">
|
||||
<h3>{{$title}}</h3>
|
||||
</span>
|
||||
|
||||
<div id="markdown-wrapper">
|
||||
{{include file="field_checkbox.tpl" field=$enabled}}
|
||||
</div>
|
||||
<div class="settings-submit-wrapper" >
|
||||
<input type="submit" id="markdown-submit" name="markdown-submit" class="settings-submit" value="{{$submit}}" />
|
||||
</div>
|
||||
</div>
|
||||
{{include file="field_checkbox.tpl" field=$enabled}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue