Example #1
0
 /**
  * Determines if a user has an active subscription 
  * of the specified type
  * 
  * @param int $user_id
  * @param int $sub_type_id
  * @return boolean
  */
 function hasActiveSub($user_id, $sub_type_id)
 {
     if (!$this->isInstalled()) {
         return null;
     }
     JLoader::import('com_ambrasubs.helpers.subscription', JPATH_ADMINISTRATOR . DS . 'components');
     if (AmbrasubsHelperSubscription::isUser($user_id, $sub_type_id, '0', '1')) {
         return true;
     }
     return false;
 }
Example #2
0
 /**
  * Gets a select list of Ambrasubs Subscription Types
  * 
  * @param $selected
  * @param $name
  * @param $attribs
  * @param $idtag
  * @param $allowAny
  * @param $allowNone
  * @param $title
  * @param $title_none
  * @param $enabled
  * @return unknown_type
  */
 function selectTypes($selected, $name = 'ambrasubs_type_id', $attribs = array('class' => 'inputbox', 'size' => '1'), $idtag = null, $allowAny = false, $allowNone = false, $title = 'Select Subscription Type', $title_none = 'No Subscription Type', $enabled = null)
 {
     Tienda::load("AmbrasubsHelperSubscription", 'helpers.subscription', array('site' => 'admin', 'type' => 'components', 'ext' => 'com_ambrasubs'));
     $list = AmbrasubsHelperSubscription::getSelectListTypes('', 0);
     return JHTML::_('select.genericlist', $list, $name, $attribs, 'value', 'text', $selected);
 }