예제 #1
0
    function getMenusToHide($userid)
    {
        $jsmodel = XiptFactory::getInstance('jstoolbar', 'model');
        $pID = XiptLibProfiletypes::getUserData($userid, 'PROFILETYPE');
        $query = new XiptQuery();
        $menuids = $query->select('menuid')->from('#__xipt_jstoolbar')->where(" `profiletype` = {$pID} ")->dbLoadQuery("", "")->loadResultArray();
        if (empty($menuids)) {
            return false;
        }
        foreach ($menuids as $menuid) {
            $result = $jsmodel->getMenu($menuid);
            $hideMenu = XiptRoute::_("{$result->link}");
            ob_start();
            ?>
	        joms.jQuery(document).ready(function(){	
				var menuUrl = "<?php 
            echo $hideMenu;
            ?>
".replace(/\&amp\;/gi, "&");
				joms.jQuery("a[href='" + menuUrl + "']").hide();	
			});	
	        <?php 
            $content = ob_get_contents();
            ob_clean();
            JFactory::getDocument()->addScriptDeclaration($content);
        }
    }
예제 #2
0
 function getProfileTypes($aid)
 {
     if (isset($this->_ptypes[$aid])) {
         return $this->_ptypes[$aid];
     }
     $query = new XiptQuery();
     return $this->_ptypes[$aid] = $query->select('profiletype')->from('#__xipt_applications')->where(" `applicationid` = {$aid} ")->dbLoadQuery("", "")->loadResultArray();
 }
예제 #3
0
 function getProfileTypes($menuid)
 {
     if (isset($this->_ptypes[$menuid])) {
         return $this->_ptypes[$menuid];
     }
     $query = new XiptQuery();
     return $this->_ptypes[$menuid] = $query->select('profiletype')->from('#__xipt_jstoolbar')->where(" `menuid` = {$menuid} ")->dbLoadQuery("", "")->loadResultArray();
 }
예제 #4
0
 static function getPluginStatus($plugin)
 {
     $query = new XiptQuery();
     if (XIPT_JOOMLA_15) {
         return $query->select('*')->from('#__plugins')->where(" `element` = '{$plugin}' ")->dbLoadQuery("", "")->loadObject();
     } else {
         return $query->select('*')->from('#__extensions')->where(" `element` = '{$plugin}' ")->dbLoadQuery("", "")->loadObject();
     }
 }
예제 #5
0
 function getModule($modId = 0)
 {
     $query = new XiptQuery();
     $query->select('*');
     $query->from('#__modules');
     $query->where("`id` = {$modId}");
     $module = $query->dbLoadQuery("", "")->loadObject();
     return $module;
 }
예제 #6
0
 function getGroups($id = '')
 {
     $query = new XiptQuery();
     $query->select(' `id`, `name` ')->from('#__community_groups');
     if (!empty($id)) {
         $query->where(" `id`  = {$id} ");
     }
     return $query->dbLoadQuery("", "")->loadObjectList();
     /* TODO : what if group list is empty */
 }
예제 #7
0
 function getFeatureCounts($resourceAccesser, $catId)
 {
     if ($catId) {
         $condition = "AND `categoryid`= {$catId}";
     } else {
         $condition = '';
     }
     $query = new XiptQuery();
     return $query->select('COUNT(*)')->from('#__community_groups')->where(" `ownerid` = {$resourceAccesser} {$condition} ")->dbLoadQuery("", "")->loadResult();
 }
예제 #8
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'];
     }
 }
예제 #9
0
 function getJUserTypes()
 {
     $values = array(JOOMLA_USER_TYPE_NONE);
     $query = new XiptQuery();
     if (XIPT_JOOMLA_15) {
         $val = $query->select('*')->from('#__core_acl_aro_groups')->where(" `name` <> 'ROOT' ", 'AND')->where(" `name` <> 'USERS' ", 'AND')->where(" `name` <> 'Public Frontend' ", 'AND')->where(" `name` <> 'Public Backend' ", 'AND')->where(" `name` <> 'Super Administrator' ", 'AND')->where(" `name` <> 'Administrator' ", 'AND')->dbLoadQuery("", "")->loadObjectList('name');
     } else {
         $val = $query->select('*')->from('#__usergroups')->dbLoadQuery("", "")->loadObjectList('title');
     }
     if ($val) {
         return array_merge($values, array_keys($val));
     }
     return $values;
 }
예제 #10
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;
     }
 }
예제 #11
0
 function getAllModules($published = '')
 {
     $query = new XiptQuery();
     $query->select('*');
     $query->from('#__modules');
     $query->where("`published` = {$published}");
     $query->order('ordering');
     $modules = $query->dbLoadQuery("", "")->loadObjectList();
     return $modules;
 }
예제 #12
0
 function getJomsocialProfileFields($filter = '', $join = 'AND')
 {
     $query = new XiptQuery();
     $query->select('*');
     $query->from('#__community_fields');
     //setting up the search condition is there is any
     if (!empty($filter)) {
         foreach ($filter as $column => $value) {
             $query->where(" `{$column}` = '{$value}' ", $join);
         }
     }
     $query->order('ordering');
     $fields = $query->dbLoadQuery("", "")->loadObjectList();
     return $fields;
 }
예제 #13
0
 function getFeatureCounts($resourceAccesser, $resourceOwner, $otherptype, $aclSelfPtype)
 {
     $query = new XiptQuery();
     return $query->select('COUNT(*)')->from('#__community_videos')->where(" `creator` = {$resourceAccesser} ", 'AND')->where(" `published` = '1' ", 'AND')->where(" `status` = 'ready' ")->dbLoadQuery("", "")->loadResult();
 }
예제 #14
0
 public function getTotalUsers($pid)
 {
     $query = new XiptQuery();
     return $query->select('count(1)')->from('#__xipt_users')->where("`profiletype` = {$pid}")->dbLoadQuery("", "")->loadResult();
 }
예제 #15
0
 /** 
  * check for the row if already exists, according to promary key
  * 
  * @access public
  * @param int primary key
  * @return null|string null if successful otherwise returns and error message
  */
 function isRowExists($pk)
 {
     $query = new XiptQuery();
     return $query->select('*')->from($this->getTableName())->where(" `{$this->getKeyName()}` = {$pk} ")->dbLoadQuery("", "")->loadObject();
 }
예제 #16
0
 function getownerId($id)
 {
     $query = new XiptQuery();
     return $query->select('creator')->from('#__community_photos')->where(" `id` = {$id} ")->dbLoadQuery("", "")->loadResult();
 }
예제 #17
0
 function delete($oid, $glue = 'AND')
 {
     //if its a pk, then simple call parent
     if (is_array($oid) === false) {
         return parent::delete($oid);
     }
     // if an array/ means not a primiary key
     //Support multiple key-value pair in $oid
     //rather then deleting on behalf of key only
     if (empty($oid) || count($oid) <= 0) {
         return false;
     }
     $query = new XiptQuery();
     $query->delete()->from($this->getTableName());
     foreach ($oid as $key => $value) {
         $query->where(" `{$key}`  = '{$value}' ", $glue);
     }
     // XITODO : generate warning if record does not exists
     return $query->dbLoadQuery("", "")->query();
 }
예제 #18
0
 function _isMemberOfGroup($userid, $groupid)
 {
     $query = new XiptQuery();
     $result = $query->select('memberid')->from('#__community_groups_members')->where(" memberid = {$userid} ", 'AND')->where(" groupid IN ( {$groupid} ) ")->limit(1)->dbLoadQuery()->loadResult();
     return $result ? true : false;
 }
예제 #19
0
 function resetUserAvatar($pid, $newavatar, $oldavatar, $newavatarthumb)
 {
     //get all users for profiletype
     $users = XiptLibProfiletypes::getAllUsers($pid);
     //Change all avatar and thumb path in url formate
     $newavatar = XiptHelperUtils::getUrlpathFromFilePath($newavatar);
     $newavatarthumb = XiptHelperUtils::getUrlpathFromFilePath($newavatarthumb);
     $cnt = count($users);
     for ($i = 0; $i < $cnt; $i++) {
         //if user is admin unset value
         if (XiptHelperUtils::isAdmin($users[$i])) {
             unset($users[$i]);
         }
     }
     $users = array_values($users);
     $cnt = count($users);
     if ($cnt > 0) {
         // XITODO : Change IN query to sub query
         //update user avatar and thumb of all users who doesn't have custom avatar
         $query = new XiptQuery();
         $result = $query->update('#__community_users')->set(" avatar = '{$newavatar}' ")->set(" thumb = '{$newavatarthumb}' ")->where(" avatar = '{$oldavatar}' ")->where(" userid  IN (" . implode(",", $users) . ") ")->dbLoadQuery()->query();
         if (!$result) {
             return XiptError::raiseWarning(500, XiptText::_("ERROR_IN_DATABASE_WHEN_SAVING_AVATAR_IN_COMMUNITY_USER_TABLE"));
         }
         return true;
     }
 }
예제 #20
0
 function getFeatureCounts($resourceAccesser, $resourceOwner, $otherptype, $aclSelfPtype)
 {
     $query = new XiptQuery();
     return $query->select('COUNT(*)')->from('#__community_photos_albums')->where(" `creator` = {$resourceAccesser} ")->dbLoadQuery("", "")->loadResult();
 }
예제 #21
0
 function disableCustomFields()
 {
     $query = new XiptQuery();
     return $query->update('#__community_fields')->set(" `published` = 0 ")->where(" `type` = 'profiletypes' ", 'OR')->where(" `type` = 'templates' ", 'OR')->dbLoadQuery("", "")->query();
 }
예제 #22
0
 function getCategoryId($groupid)
 {
     $query = new XiptQuery();
     return $query->select('categoryid')->from('#__community_groups')->where("`id` = {$groupid}")->dbLoadQuery("", "")->loadResult();
 }
예제 #23
0
 function isFriend($userId, $viewUserId)
 {
     $query = new XiptQuery();
     return $query->select('connection_id')->from('#__community_connection')->where(" connect_from = {$userId} ", 'AND')->where(" connect_to = {$viewUserId} ", 'AND')->where(" status = 1 ")->dbLoadQuery()->loadResult();
 }
예제 #24
0
파일: aec.php 프로젝트: Simarpreet05/joomla
 public static function getPlan($planid)
 {
     $query = new XiptQuery();
     $result = $query->select('*')->from('#__acctexp_plans')->dbLoadQuery()->loadObjectList('id');
     if (!isset($result[$planid])) {
         return null;
     }
     return $result[$planid];
 }
예제 #25
0
 function _switchFieldState($state)
 {
     $query = new XiptQuery();
     return $query->update('#__community_fields')->set(" published = '{$state}' ")->where(" type = 'profiletypes' ", 'OR')->where(" type = 'templates' ")->dbLoadQuery()->query();
 }
예제 #26
0
 function getXiptApps()
 {
     $query = new XiptQuery();
     return $query->select('*')->from('#__payplans_app')->where(" `type` = 'xiprofiletype' ")->dbLoadQuery("", "")->loadResult();
 }