* @version $Revision: 1.1 $ * @since PHP 4.1 */ require_once SGL_MOD_DIR . '/newsletter/classes/NewsletterMgr.php'; require_once SGL_MOD_DIR . '/newsletter/classes/Output.php'; class Newsletter_Block_Subscribe { function init($output) { SGL::logMessage(null, PEAR_LOG_DEBUG); $this->userID = isset($output->loggedOnUserID) ? $output->loggedOnUserID : ''; $this->username = isset($output->loggedOnUser) ? $output->loggedOnUser : ''; return $this->getBlockContent(); } function getBlockContent() { if ($this->username) { $news = & new NewsletterMgr(); $lists = $news->_getList(); $subscribedLists = $news->getSubscribedLists($this->userID); $unsubscribedLists = $news->getUnsubscribedLists($this->userID); $text = '
Current Subscriptions: |
'. $subscribedNewsLists .' |
Available Subscriptions: |
'. $unsubscribedNewsLists .' |