function getParams($refresh = false) { //for testing purpose clean cache $refresh = XiptLibJomsocial::cleanStaticCache(); if (isset($this->_params) && $refresh === false) { return $this->_params; } return $this->_params = $this->loadParams('settings', 'params'); }
function getFieldId($fieldcode) { static $results = array(); $reset = XiptLibJomsocial::cleanStaticCache(); if (isset($results[$fieldcode]) && $reset == false) { return $results[$fieldcode]['id']; } $query = new XiptQuery(); $results = $query->select('*')->from('#__community_fields')->dbLoadQuery()->loadAssocList('fieldcode'); if (array_key_exists($fieldcode, $results)) { return $results[$fieldcode]['id']; } }
function doApply() { $msg = ""; if (CConfig::getInstance()->get('profile_multiprofile', 0)) { XiptLibJomsocial::saveValueinJSConfig(); $msg = XiptText::_("JS_MULTIPROFILETYPE_DISABLED"); } if (XiptHelperUtils::changePluginState('xipt_community', 1) == false || XiptHelperUtils::changePluginState('xipt_system', 1) == false) { $msg .= XiptText::_("PLUGINS_NOT_ENABLE"); } else { $msg .= XiptText::_("PLUGINS_ENABLED_SUCCESSFULLY"); } $msg .= XiptSetupRuleJsfields::doApply(); $msg .= XiptSetupRulePatchfiles::doApply(); return $msg; }
function loadParams($id, $what = 'params') { $reset = XiptLibJomsocial::cleanStaticCache(); if ($what != 'params') { return parent::loadParams($id, $what); } if (isset($this->_params[$id]) && $reset == false) { return $this->_params[$id]; } $record = $this->loadRecords(0); // if config not found from tabale then load default config of jom social if (!isset($record[$id]->params) || empty($record[$id]->params)) { $this->_params[$id] = CFactory::getConfig(); } else { $this->_params[$id] = new XiptParameter($record[$id]->params); } return $this->_params[$id]; }
function edit($fieldId, $tpl = 'edit') { //XITODO : duplicate call, remove it $field = XiptLibJomsocial::getFieldObject($fieldId); $fields = XiptLibJomsocial::getFieldObject(); $categories = XiptHelperProfilefields::getProfileFieldCategories(); $this->assign('fields', $fields); $this->assign('field', $field); $this->assignRef('categories', $categories); $this->assign('fieldid', $fieldId); // Set the titlebar text JToolBarHelper::title(XiptText::_('EDIT_FIELD'), 'profilefields'); $pane =& JPane::getInstance('sliders'); $this->assignRef('pane', $pane); // Add the necessary buttons JToolBarHelper::back('Home', 'index.php?option=com_xipt&view=profilefields'); JToolBarHelper::divider(); JToolBarHelper::save('save', 'COM_XIPT_SAVE'); JToolBarHelper::cancel('cancel', 'COM_XIPT_CLOSE'); parent::display($tpl); }
function getPluginId($element, $folder = 'community') { $reset = XiptLibJomsocial::cleanStaticCache(); static $plugin = null; if ($plugin == null || !isset($plugin[$folder]) || $reset) { $query = new XiptQuery(); if (XIPT_JOOMLA_15) { $plugin[$folder] = $query->select('*')->from('#__plugins')->where(" `folder` = '{$folder}' ")->dbLoadQuery("", "")->loadObjectList('element'); } else { $plugin[$folder] = $query->select('*')->from('#__extensions')->where(" `folder` = '{$folder}' ")->dbLoadQuery("", "")->loadObjectList('element'); } } if (isset($plugin[$folder][$element])) { if (XIPT_JOOMLA_15) { return $plugin[$folder][$element]->id; } else { return $plugin[$folder][$element]->extension_id; } } else { return false; } }
function onAfterConfigCreate($config) { return XiptLibJomsocial::updateCommunityConfig($config); }
public function loadRecords($limit = null, $limitstart = null) { if ($limit === null) { $limit = $this->getState('limit', null); } if ($limitstart === null) { $limitstart = $this->getState('limitstart', 0); } $query = $this->getQuery(); //there might be no table and no query at all if ($query === null) { return null; } //we want returned record indexed by columns $pKey = $this->getTable()->getKeyName(); $query->limit($limit, $limitstart); //for unique indexing using md5 $index = md5($query->__toString()); $reset = XiptLibJomsocial::cleanStaticCache(); if (isset($this->_recordlist[$index]) && $reset == false) { return $this->_recordlist[$index]; } $this->_recordlist[$index] = $query->dbLoadQuery("", "")->loadObjectList($pKey); return $this->_recordlist[$index]; }
function getDefaultProfiletype() { $refresh = XiptLibJomsocial::cleanStaticCache(); static $defaultProfiletypeID = null; if ($defaultProfiletypeID && $refresh === false) { return $defaultProfiletypeID; } $defaultProfiletypeID = XiptFactory::getSettings('defaultProfiletypeID'); if ($defaultProfiletypeID) { return $defaultProfiletypeID; } echo XiptFactory::getSettings()->render(); XiptError::raiseWarning('DEF_PTYPE_REQ', 'DEFAULT PROFILE TYPE REQUIRED'); }
function getJSProfileFields($fieldId = 0) { return XiptLibJomsocial::getFieldObject($fieldId); }
function updateCommunityUserGroup($userId, $oldGroup, $newGroup) { // remove from oldGroup if ($oldGroup && self::_isMemberOfGroup($userId, $oldGroup)) { XiptLibJomsocial::_removeUserFromGroup($userId, $oldGroup); } // add to newGroup if ($newGroup && self::_isMemberOfGroup($userId, $newGroup) == false) { XiptLibJomsocial::_addUserToGroup($userId, $newGroup); } // add to new group return true; }