Example #1
0
 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');
 }
Example #2
0
 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'];
     }
 }
Example #3
0
 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;
 }
Example #4
0
 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];
 }
Example #5
0
 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);
 }
Example #6
0
 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;
     }
 }
Example #7
0
 function onAfterConfigCreate($config)
 {
     return XiptLibJomsocial::updateCommunityConfig($config);
 }
Example #8
0
 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];
 }
Example #9
0
 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');
 }
Example #10
0
 function getJSProfileFields($fieldId = 0)
 {
     return XiptLibJomsocial::getFieldObject($fieldId);
 }
Example #11
0
 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;
 }