+
+function irc_addon_settings(&$a,&$s) {
+ if(! local_user())
+ return;
+
+ /* Add our stylesheet to the page so we can make our settings look nice */
+
+// $a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . $a->get_baseurl() . '/addon/irc/irc.css' . '" media="all" />' . "\r\n";
+
+ /* setting popular channels, auto connect channels */
+ $sitechats = PConfig::get( local_user(), 'irc','sitechats'); /* popular channels */
+ $autochans = PConfig::get( local_user(), 'irc','autochans'); /* auto connect chans */
+
+ $t = get_markup_template( "settings.tpl", "addon/irc/" );
+ $s .= replace_macros($t, [
+ '$header' => L10n::t('IRC Settings'),
+ '$info' => 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' => L10n::t('Save Settings'),
+ '$autochans' => [ 'autochans', L10n::t('Channel(s) to auto connect (comma separated)'), $autochans, L10n::t('List of channels that shall automatically connected to when the app is launched.')],
+ '$sitechats' => [ 'sitechats', L10n::t('Popular Channels (comma separated)'), $sitechats, L10n::t('List of popular channels, will be displayed at the side and hotlinked for easy joining.') ]
+ ]);
+
+
+ return;
+
+}
+
+function irc_addon_settings_post(&$a,&$b) {
+ if(! local_user())
+ return;
+
+ if($_POST['irc-submit']) {
+ PConfig::set( local_user(), 'irc','autochans',trim($_POST['autochans']));
+ PConfig::set( local_user(), 'irc','sitechats',trim($_POST['sitechats']));
+ /* upid pop-up thing */
+ info(L10n::t('IRC settings saved.') . EOL);
+ }
+}
+