- $sitechats = get_config('irc','sitechats'); /* popular channels */
- $autochans = get_config('irc','autochans'); /* auto connect chans */
-
- $s .= '<span id="settings_irc_inflated" class="settings-block fakelink" style="display: block;" onclick="openClose(\'settings_irc_expanded\'); openClose(\'settings_irc_inflated\');">';
- $s .= '<h3>' . t('IRC Settings') . '</h3>';
- $s .= '</span>';
- $s .= '<div id="settings_irc_expanded" class="settings-block" style="display: none;">';
- $s .= '<span class="fakelink" onclick="openClose(\'settings_irc_expanded\'); openClose(\'settings_irc_inflated\');">';
- $s .= '<h3>' . t('IRC Settings') . '</h3>';
- $s .= '</span>';
-
- $s .= '<div class="settings-block">';
- $s .= '<h3>' . t('IRC Settings') . '</h3>';
- $s .= '<div id="irc-chans">';
- $s .= '<label id="irc-auto-label" for="autochans">' . t('Channel(s) to auto connect (comma separated)') . '</label>';
- $s .= '<input id="irc-autochans" type="text" name="autochans" value="' . $autochans .'" />';
- $s .= '</div><div class="clear"></div>';
-
- $s .= '<div id="irc-popchans">';
- $s .= '<label id="irc-pop-label" for="sitechats">' . t('Popular Channels (comma separated)') . '</label>';
- $s .= '<input id="irc-sitechats" type="text" name="sitechats" value="' . $sitechats.'" />';
- $s .= '</div><div class="clear"></div>';
-
- $s .= '<div class="settings-submit-wrapper" ><input type="submit" id="irc-submit" name="irc-submit" class="settings-submit" value="' . t('Save Settings') . '" /></div></div>';
- $s .= '</div>';
+ $sitechats = DI::pConfig()->get( local_user(), 'irc','sitechats'); /* popular channels */
+ $autochans = DI::pConfig()->get( local_user(), 'irc','autochans'); /* auto connect chans */
+
+ $t = Renderer::getMarkupTemplate( "settings.tpl", "addon/irc/" );
+ $s .= Renderer::replaceMacros($t, [
+ '$header' => DI::l10n()->t('IRC Settings'),
+ '$info' => DI::l10n()->t('Here you can change the system wide settings for the channels to automatically join and access via the side bar. Note the changes you do here, only effect the channel selection if you are logged in.'),
+ '$submit' => DI::l10n()->t('Save Settings'),
+ '$autochans' => [ 'autochans', DI::l10n()->t('Channel(s) to auto connect (comma separated)'), $autochans, DI::l10n()->t('List of channels that shall automatically connected to when the app is launched.')],
+ '$sitechats' => [ 'sitechats', DI::l10n()->t('Popular Channels (comma separated)'), $sitechats, DI::l10n()->t('List of popular channels, will be displayed at the side and hotlinked for easy joining.') ]
+ ]);
+