Exemplo n.º 1
0
 /**
  * Method to get the subscriber ID of the user
  *
  * @access	public
  *
  * @return 	int     $subscriberid   id of the subscriber
  */
 public static function getSubscriberID()
 {
     $user = JFactory::getUser();
     if ($user->get('guest')) {
         // User is guest
         $session = JFactory::getSession();
         $session_subscriberid = $session->get('session_subscriberid');
         if (isset($session_subscriberid) && is_array($session_subscriberid)) {
             // A session_subscriber id exists
             $subscriberid = $session_subscriberid['id'];
         } else {
             // No session_subscriber id exists
             $subscriberid = 0;
         }
     } else {
         // User is logged in
         $subscriberid = modBwPostmanHelper::getSubscriberIDfromUserID($user->get('id'));
     }
     return $subscriberid;
 }
Exemplo n.º 2
0
        $gender .= '<input type="radio" name="a_gender" id="genFemaleMod" value="1"';
        if ($gender_selected) {
            $gender .= 'checked="checked"';
        }
        $gender .= '/>';
        $gender .= '<label for="genFemaleMod"><span>' . JText::_('MOD_BWPOSTMAN_FEMALE') . '</span></label>';
        $gender .= '</fieldset>';
        $lists['gender'] = $gender;
        // Get the usertype
        $usertype = JUserHelper::getUserGroups($userid);
        // Get the checked mailinglists from module parameters
        $mod_mls = $params->get('mod_ml_available');
        // Get the available mailinglists
        $mailinglists = modBwPostmanHelper::getMailinglists($usertype, $mod_mls);
        $n = count($mailinglists);
        // Build the mailinglist select list
        $available_mailinglists = array();
        // only when count($mailinglists) > 0
        if ($n > 0) {
            foreach ($mailinglists as $mailinglist) {
                $available_mailinglists[] = JHTML::_('select.option', $mailinglist->id, $mailinglist->title . ':<br />' . $mailinglist->description);
            }
        }
        $lists['list'] = JHTML::_('select.genericlist', $available_mailinglists, 'list[]', 'class="inputbox" size="' . $n . '" multiple="multiple" style="padding: 6px; width: 150px;"', 'value', 'text');
    }
    $itemid = modBwPostmanHelper::getItemID();
    $path = JModuleHelper::getLayoutPath('mod_bwpostman', $layout);
    if (file_exists($path)) {
        require $path;
    }
}