function getProfileNewsletterList($userId) { $retVal = '<fieldset style="padding: 8px"><legend>My Newsletters</legend>'; global $urlRequestRoot, $cmsFolder, $sourceFolder, $moduleFolder, $templateFolder; include_once "{$sourceFolder}/{$moduleFolder}/newsletter.lib.php"; $subscribableLists = newsletter::getSubscribableLists($userId); $subscribedLists = ''; $unsubscribedLists = ''; for ($i = 0; $i < count($subscribableLists); ++$i) { if ($subscribableLists[$i][2] === true) { $subscribedLists .= '<span class="newsletterlistitem"><a href="' . $subscribableLists[$i][1] . '" />' . $subscribableLists[$i][0] . '</a></span>'; } else { $unsubscribedLists .= '<span class="newsletterlistitem"><a href="' . $subscribableLists[$i][1] . '" />' . $subscribableLists[$i][0] . '</a></span>'; } } $imageDir = "{$urlRequestRoot}/{$cmsFolder}/{$templateFolder}/common/icons/16x16/actions/"; $retVal .= '<table border="0" cellpadding="4" cellspacing="4"><tr><th>Available Lists</th><th></th><th>Lists I\'ve subscribed to</th><tr><td width="45%">'; $retVal .= '<span class="newsletterlist" style="float: left" id="unsubscribedLists">' . $unsubscribedLists . '</span>'; $retVal .= '</td><td style="vertical-align: center; text-align: center"><img src="' . $imageDir . 'go-next.gif" /><br /><br /><img src="' . $imageDir . 'go-previous.gif" /></td><td width="45%">'; $retVal .= '<span class="newsletterlist" style="float: right" id="subscribedLists">' . $subscribedLists . '</span>'; $retVal .= '</td></tr></table>'; $retVal .= '</fieldset>'; return $retVal; }