function Settings() { //require_once ( JPATH_ROOT.DS.'components'.DS.'com_xipt'.DS.'includes.php'); require_once JPATH_ROOT . DS . 'components' . DS . 'com_xipt' . DS . 'api.xipt.php'; $database =& JFactory::getDBO(); $settings = array(); $settings['profiletype'] = array('list'); $settings['profiletype_after_exp'] = array('list'); $filter = array('published' => 1); //new concept $profiletypes = XiptAPI::getProfiletypeInfo(0, $filter); //old concept //$profiletypes = XiptLibProfiletypes::getProfiletypeArray($filter); $spt = array(); $spte = array(); $ptype = array(); foreach ($profiletypes as $profiletype) { $ptype[] = JHTML::_('select.option', $profiletype->id, $profiletype->name); if (!empty($this->settings['profiletype'])) { if (in_array($profiletype->id, $this->settings['profiletype'])) { $spt[] = JHTML::_('select.option', $profiletype->id, $profiletype->name); } } if (!empty($this->settings['profiletype_after_exp'])) { if (in_array($profiletype->id, $this->settings['profiletype_after_exp'])) { $spte[] = JHTML::_('select.option', $profiletype->id, $profiletype->name); } } } $settings['lists']['profiletype'] = JHTML::_('select.genericlist', $ptype, 'profiletype[]', 'size="4"', 'value', 'text', $spt); $settings['lists']['profiletype_after_exp'] = JHTML::_('select.genericlist', $ptype, 'profiletype_after_exp[]', 'size="4"', 'value', 'text', $spte); return $settings; }
function _validatePT($ptid) { $pt = XiptAPI::getProfiletypeInfo($ptid); if (count($pt) == 1 && $pt[0]->id == $ptid) { return true; } return false; }
function _validatePT($ptid) { //vaibhav if (JFolder::exists(JPATH_BASE . DS . 'components' . DS . 'com_xipt')) { $pt = XiptAPI::getProfiletypeInfo($ptid); } if (count($pt) == 1 && $pt[0]->id == $ptid) { return true; } return false; }
public function isApprovalRequired($user_id) { $file = JPATH_BASE . DS . 'components' . DS . 'com_xipt' . DS . 'api.xipt.php'; if (JFile::exists($file) && (include_once $file)) { $pID = XiptAPI::getUserProfiletype($user_id); // TODO : what to do for $pId =0 $allCondition = array(); $allCondition = XiptAPI::getProfiletypeInfo($pID); // if admin approval NOT required, then do nothing let the joomla handle if ($allCondition && $pID) { return $allCondition[0]->approve; } } return false; }