Ejemplo n.º 1
0
 function display($tpl = null)
 {
     $uid = JRequest::getString('uid', '');
     $nid = JRequest::getString('nid', '');
     $user = JFactory::getUser();
     $subscriber = JModel::getInstance('Subscriber', 'NewsletterModelEntity');
     if (!empty($uid)) {
         $subscriber->load(array('subscription_key' => $uid));
     } elseif (!empty($user->id)) {
         $subscriber->load('-' . $user->id);
     }
     $lists = SubscriberHelper::getLists($subscriber->subscription_key);
     $this->assignRef('user', $user);
     $this->assignRef('subscriber', $subscriber->toObject());
     $this->assignRef('lists', $lists);
     $this->assign('uid', $subscriber->subscription_key);
     $this->assign('nid', $nid);
     $this->setDocument();
     parent::display();
 }