Alex Trofimov 12 лет назад
Родитель
Сommit
4a405c8f80

+ 2 - 1
modules/boonex/organizations/classes/BxOrgsConfig.php

@@ -55,7 +55,8 @@ class BxOrgsConfig extends BxBaseModProfileConfig
             // some params
             'PARAM_AUTOAPPROVAL' => 'bx_organizations_autoapproval',
             'PARAM_DEFAULT_ACL_LEVEL' => 'bx_organizations_default_acl_level',
-            'PARAM_NUM_RSS' => '', // TODO:
+            'PARAM_NUM_RSS' => 'bx_organizations_num_rss',
+            'PARAM_NUM_CONNECTIONS_QUICK' => 'bx_organizations_num_connections_quick',
 
             // objects
             'OBJECT_STORAGE' => 'bx_organizations_pics',

+ 6 - 25
modules/boonex/organizations/classes/BxOrgsSearchResult.php

@@ -63,35 +63,16 @@ class BxOrgsSearchResult extends BxBaseModProfileSearchResult
         switch ($sMode) {
 
             case 'connections':
-                bx_import('BxDolConnection');
-                $oConnection = isset($aParams['object']) ? BxDolConnection::getObjectInstance($aParams['object']) : false;
-                if ($oConnection && isset($aParams['profile']) && (int)$aParams['profile']) {
-
+                if ($this->_setConnectionsConditions($aParams)) {
                     $oProfile = BxDolProfile::getInstance($aParams['profile']);
+                    $oProfile2 = isset($aParams['profile2']) ? BxDolProfile::getInstance($aParams['profile2']) : null;
 
-                    $sMethod = 'getConnectedContentAsCondition';
-                    if (isset($aParams['type']) && $aParams['type'] == 'initiators')
-                        $sMethod = 'getConnectedInitiatorsAsCondition';
-
-                    if (isset($aParams['type']) && $aParams['type'] == 'common') {
-
-                        $a = $oConnection->getCommonContentAsCondition('id', (int)$aParams['profile'], (int)$aParams['profile2'], isset($aParams['mutual']) ? $aParams['mutual'] : false);
-                        $oProfile2 = BxDolProfile::getInstance($aParams['profile2']);
-                        if ($oProfile && $oProfile2)
-                            $this->aCurrent['title'] = _t('_bx_orgs_page_title_browse_connections_mutual', $oProfile->getDisplayName(), $oProfile2->getDisplayName());
-
-                    } else {
+                    if (isset($aParams['type']) && $aParams['type'] == 'common' && $oProfile && $oProfile2)
+                        $this->aCurrent['title'] = _t('_bx_orgs_page_title_browse_connections_mutual', $oProfile->getDisplayName(), $oProfile2->getDisplayName());
+                    elseif ((!isset($aParams['type']) || $aParams['type'] != 'common') && $oProfile)
+                        $this->aCurrent['title'] = _t('_bx_orgs_page_title_browse_connections', $oProfile->getDisplayName());
 
-                        $a = $oConnection->$sMethod('id', (int)$aParams['profile'], isset($aParams['mutual']) ? $aParams['mutual'] : false);
-                        if ($oProfile)
-                            $this->aCurrent['title'] = _t('_bx_orgs_page_title_browse_connections', $oProfile->getDisplayName());
-
-                    }
-
-                    $this->aCurrent['restriction'] = array_merge($this->aCurrent['restriction'], $a['restriction']);
-                    $this->aCurrent['join'] = array_merge($this->aCurrent['join'], $a['join']);
                     $this->aCurrent['rss']['link'] = 'modules/?r=orgs/rss/' . $sMode . '/' . $aParams['object'] . '/' . $aParams['type'] . '/' . (int)$aParams['profile'] . '/' . (int)$aParams['profile2'] . '/' . (int)$aParams['mutual'];
-
                 }
                 break;
 

+ 2 - 0
modules/boonex/organizations/install/langs/en.xml

@@ -5,6 +5,8 @@
 
 	<string name="_bx_orgs_option_autoapproval"><![CDATA[Activate all organizations after creation automatically]]></string>
 	<string name="_bx_orgs_option_default_acl_level"><![CDATA[Default level to assign after organizations's profile creation]]></string>
+	<string name="_bx_orgs_option_num_connections_quick"><![CDATA[Number of items in friends block]]></string>
+	<string name="_bx_orgs_option_num_rss"><![CDATA[Number of items in RSS feed]]></string>
 
 	<string name="_bx_orgs_form_profile"><![CDATA[Organizations]]></string>
 	<string name="_bx_orgs_form_profile_display_add"><![CDATA[Add Organization]]></string>

+ 3 - 1
modules/boonex/organizations/install/sql/enable.sql

@@ -12,7 +12,9 @@ SET @iCategId = LAST_INSERT_ID();
 
 INSERT INTO `sys_options` (`name`, `value`, `category_id`, `caption`, `type`, `extra`, `check`, `check_error`, `order`) VALUES
 ('bx_organizations_autoapproval', 'on', @iCategId, '_bx_orgs_option_autoapproval', 'checkbox', '', '', '', 1),
-('bx_organizations_default_acl_level', '2', @iCategId, '_bx_orgs_option_default_acl_level', 'select', 'PHP:bx_import(''BxDolAcl''); return BxDolAcl::getInstance()->getMemberships(false, true);', '', '', 2);
+('bx_organizations_default_acl_level', '2', @iCategId, '_bx_orgs_option_default_acl_level', 'select', 'PHP:bx_import(''BxDolAcl''); return BxDolAcl::getInstance()->getMemberships(false, true);', '', '', 2),
+('bx_organizations_num_connections_quick', '4', @iCategId, '_bx_orgs_option_num_connections_quick', 'digit', '', '', '', 10),
+('bx_organizations_num_rss', '10', @iCategId, '_bx_orgs_option_num_rss', 'digit', '', '', '', 12);
 
 -- STORAGES & TRANSCODERS