+/**
+ * Get current list of subscribed non-RFC-compliant mailing lists for logged-in user
+ *
+ * @return array The list of mailing list addresses, keyed by integer index
+ */
+function get_non_rfc_lists() {
+ global $username, $data_dir;
+ $lists = getPref($data_dir, $username, 'non_rfc_lists', array());
+ $new_lists = array();
+ if (!empty($lists)) {
+ $lists = explode(':', $lists);
+ foreach ($lists as $list) {
+ list($index, $list_addr) = explode('_', $list);
+ if ((!empty($index) || $index === '0') && !empty($list_addr))
+ $new_lists[$index] = $list_addr;
+ }
+ }
+ $lists = $new_lists;
+ sort($lists);
+ return $lists;
+}
+
+/**
+ * Show mailing list management option section on options page
+ */
+function plugin_listcommands_optpage_register_block_do()
+{
+
+ global $optpage_blocks, $listcommands_allow_non_rfc_list_management;
+
+ // only allow management of non-RFC lists if admin deems necessary
+ //
+ @include_once(SM_PATH . 'plugins/listcommands/config.php');
+ if (!$listcommands_allow_non_rfc_list_management)
+ return;
+
+ $optpage_blocks[] = array(
+ 'name' => _("Mailing Lists"),
+ 'url' => '../plugins/listcommands/options.php',
+ 'desc' => _("Manage the (non-RFC-compliant) mailing lists that you are subscribed to for the purpose of providing one-click list replies when responding to list messages."),
+ 'js' => false
+ );
+
+}
+