AntonLV 9 лет назад
Родитель
Сommit
ab736740a1

+ 25 - 0
modules/base/groups/classes/BxBaseModGroupsModule.php

@@ -221,6 +221,31 @@ class BxBaseModGroupsModule extends BxBaseModProfileModule
         return $s;
         return $s;
     }
     }
 
 
+    public function serviceAdmins ($iContentId = 0)
+    {
+        $CNF = &$this->_oConfig->CNF;
+
+        if(!$iContentId)
+            $iContentId = bx_process_input(bx_get('id'), BX_DATA_INT);
+        if(!$iContentId)
+            return false;
+
+        $oGroupProfile = BxDolProfile::getInstanceByContentAndType($iContentId, $this->getName());
+        if(!$oGroupProfile)
+            return false;
+
+        $aProfiles = $this->_oDb->getAdmins($oGroupProfile->id());
+        if(empty($aProfiles) || !is_array($aProfiles))
+            return false;
+
+        $iStart = (int)bx_get('start');
+        $iLimit = !empty($CNF['PARAM_NUM_CONNECTIONS_QUICK']) ? getParam($CNF['PARAM_NUM_CONNECTIONS_QUICK']) : 4;
+        if(!$iLimit)
+            $iLimit = 4;
+
+        return $this->_serviceBrowseQuick($aProfiles, $iStart, $iLimit);
+    }
+
     public function serviceBrowseJoinedEntries ($iProfileId = 0, $bDisplayEmptyMsg = false)
     public function serviceBrowseJoinedEntries ($iProfileId = 0, $bDisplayEmptyMsg = false)
     {
     {
         if (!$iProfileId)
         if (!$iProfileId)

+ 29 - 23
modules/base/profile/classes/BxBaseModProfileModule.php

@@ -265,29 +265,7 @@ class BxBaseModProfileModule extends BxBaseModGeneralModule implements iBxDolPro
         if (!$a)
         if (!$a)
             return '';
             return '';
 
 
-        // get paginate object
-        $oPaginate = new BxTemplPaginate(array(
-            'on_change_page' => "return !loadDynamicBlockAutoPaginate(this, '{start}', '{per_page}');",
-            'num' => count($a),
-            'per_page' => $iLimit,
-            'start' => $iStart,
-        ));
-
-        // remove last item from connection array, because we've got one more item for pagination calculations only
-        if (count($a) > $iLimit)
-            array_pop($a);
-
-        // get profiles HTML
-        $s = '';
-        foreach ($a as $iProfileId) {
-            if (!($o = BxDolProfile::getInstance($iProfileId))) {
-                continue;
-            }
-            $s .= $o->getUnit();
-        }
-
-        // return profiles + paginate
-        return $s . (!$iStart && $oPaginate->getNum() <= $iLimit ?  '' : $oPaginate->getSimplePaginate());
+        return $this->_serviceBrowseQuick($a, $iStart, $iLimit);
     }
     }
 
 
 	public function serviceBrowseByAcl ($mixedLevelId, $iDesignBox = BX_DB_PADDING_DEF)
 	public function serviceBrowseByAcl ($mixedLevelId, $iDesignBox = BX_DB_PADDING_DEF)
@@ -673,6 +651,34 @@ class BxBaseModProfileModule extends BxBaseModGeneralModule implements iBxDolPro
 
 
         return $aParams;
         return $aParams;
     }
     }
+
+    protected function _serviceBrowseQuick($aProfiles, $iStart = 0, $iLimit = 4)
+    {
+        // get paginate object
+        $oPaginate = new BxTemplPaginate(array(
+            'on_change_page' => "return !loadDynamicBlockAutoPaginate(this, '{start}', '{per_page}');",
+            'num' => count($aProfiles),
+            'per_page' => $iLimit,
+            'start' => $iStart,
+        ));
+
+        // remove last item from connection array, because we've got one more item for pagination calculations only
+        if (count($aProfiles) > $iLimit)
+            array_pop($aProfiles);
+
+        // get profiles HTML
+        $s = '';
+        foreach ($aProfiles as $iProfileId) {
+            $oProfile = BxDolProfile::getInstance($iProfileId);
+            if(!$oProfile)
+                continue;
+
+            $s .= $oProfile->getUnit();
+        }
+
+        // return profiles + paginate
+        return $s . (!$iStart && $oPaginate->getNum() <= $iLimit ?  '' : $oPaginate->getSimplePaginate());
+    }
 }
 }
 
 
 /** @} */
 /** @} */

+ 1 - 0
modules/boonex/events/install/langs/en.xml

@@ -123,6 +123,7 @@
 	<string name="_bx_events_page_block_title_profile_friends_link"><![CDATA[Friends of <a href="{profile_link}">{display_name}</a>]]></string>
 	<string name="_bx_events_page_block_title_profile_friends_link"><![CDATA[Friends of <a href="{profile_link}">{display_name}</a>]]></string>
 	<string name="_bx_events_page_block_title_profile_friends"><![CDATA[Friends]]></string>
 	<string name="_bx_events_page_block_title_profile_friends"><![CDATA[Friends]]></string>
 	<string name="_bx_events_page_block_title_system_profile_friends"><![CDATA[Friends]]></string>
 	<string name="_bx_events_page_block_title_system_profile_friends"><![CDATA[Friends]]></string>
+	<string name="_bx_events_page_block_title_admins"><![CDATA[Administrators]]></string>
 	<string name="_bx_events_page_block_title_fans_link"><![CDATA[Members of <a href="{profile_link}">{display_name}</a>]]></string>
 	<string name="_bx_events_page_block_title_fans_link"><![CDATA[Members of <a href="{profile_link}">{display_name}</a>]]></string>
     <string name="_bx_events_page_block_title_fans"><![CDATA[Members]]></string>
     <string name="_bx_events_page_block_title_fans"><![CDATA[Members]]></string>
 	<string name="_bx_events_page_block_title_system_fans"><![CDATA[Members]]></string>
 	<string name="_bx_events_page_block_title_system_fans"><![CDATA[Members]]></string>

+ 1 - 0
modules/boonex/events/install/sql/enable.sql

@@ -38,6 +38,7 @@ INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `t
 ('bx_events_view_profile', 1, 'bx_events', '', '_bx_events_page_block_title_entry_social_sharing', 13, '', 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_events\";s:6:\"method\";s:21:\"entity_social_sharing\";}', 0, 0, 1, 0),
 ('bx_events_view_profile', 1, 'bx_events', '', '_bx_events_page_block_title_entry_social_sharing', 13, '', 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_events\";s:6:\"method\";s:21:\"entity_social_sharing\";}', 0, 0, 1, 0),
 ('bx_events_view_profile', 3, 'bx_events', '', '_bx_events_page_block_title_profile_calendar', 11, '', 2147483647, 'service', 'a:3:{s:6:\"module\";s:9:\"bx_events\";s:6:\"method\";s:8:\"calendar\";s:6:\"params\";a:2:{i:0;a:1:{s:5:\"event\";s:12:\"{content_id}\";}i:1;s:21:\"calendar_compact.html\";}}', 0, 0, 1, 0),
 ('bx_events_view_profile', 3, 'bx_events', '', '_bx_events_page_block_title_profile_calendar', 11, '', 2147483647, 'service', 'a:3:{s:6:\"module\";s:9:\"bx_events\";s:6:\"method\";s:8:\"calendar\";s:6:\"params\";a:2:{i:0;a:1:{s:5:\"event\";s:12:\"{content_id}\";}i:1;s:21:\"calendar_compact.html\";}}', 0, 0, 1, 0),
 ('bx_events_view_profile', 4, 'bx_events', '', '_bx_events_page_block_title_fans', 11, '', 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_events\";s:6:\"method\";s:4:\"fans\";}', 0, 0, 1, 1),
 ('bx_events_view_profile', 4, 'bx_events', '', '_bx_events_page_block_title_fans', 11, '', 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_events\";s:6:\"method\";s:4:\"fans\";}', 0, 0, 1, 1),
+('bx_events_view_profile', 4, 'bx_events', '', '_bx_events_page_block_title_admins', 11, '', 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_events\";s:6:\"method\";s:6:\"admins\";}', 0, 0, 1, 2),
 ('bx_events_view_profile', 2, 'bx_events', '', '_bx_events_page_block_title_entry_location', 11, '', 2147483647, 'service', 'a:4:{s:6:\"module\";s:6:\"system\";s:6:\"method\";s:13:\"locations_map\";s:6:\"params\";a:2:{i:0;s:9:\"bx_events\";i:1;s:12:\"{content_id}\";}s:5:\"class\";s:20:\"TemplServiceMetatags\";}', 0, 0, 1, 1);
 ('bx_events_view_profile', 2, 'bx_events', '', '_bx_events_page_block_title_entry_location', 11, '', 2147483647, 'service', 'a:4:{s:6:\"module\";s:6:\"system\";s:6:\"method\";s:13:\"locations_map\";s:6:\"params\";a:2:{i:0;s:9:\"bx_events\";i:1;s:12:\"{content_id}\";}s:5:\"class\";s:20:\"TemplServiceMetatags\";}', 0, 0, 1, 1);
 
 
 -- PAGE: view closed profile 
 -- PAGE: view closed profile 

+ 1 - 0
modules/boonex/groups/install/langs/en.xml

@@ -97,6 +97,7 @@
 	<string name="_bx_groups_page_block_title_profile_friends_link"><![CDATA[Friends of <a href="{profile_link}">{display_name}</a>]]></string>
 	<string name="_bx_groups_page_block_title_profile_friends_link"><![CDATA[Friends of <a href="{profile_link}">{display_name}</a>]]></string>
 	<string name="_bx_groups_page_block_title_profile_friends"><![CDATA[Friends]]></string>
 	<string name="_bx_groups_page_block_title_profile_friends"><![CDATA[Friends]]></string>
 	<string name="_bx_groups_page_block_title_system_profile_friends"><![CDATA[Friends]]></string>
 	<string name="_bx_groups_page_block_title_system_profile_friends"><![CDATA[Friends]]></string>
+	<string name="_bx_groups_page_block_title_admins"><![CDATA[Administrators]]></string>
 	<string name="_bx_groups_page_block_title_fans_link"><![CDATA[Members of <a href="{profile_link}">{display_name}</a>]]></string>
 	<string name="_bx_groups_page_block_title_fans_link"><![CDATA[Members of <a href="{profile_link}">{display_name}</a>]]></string>
     <string name="_bx_groups_page_block_title_fans"><![CDATA[Members]]></string>
     <string name="_bx_groups_page_block_title_fans"><![CDATA[Members]]></string>
 	<string name="_bx_groups_page_block_title_system_fans"><![CDATA[Members]]></string>
 	<string name="_bx_groups_page_block_title_system_fans"><![CDATA[Members]]></string>

+ 1 - 0
modules/boonex/groups/install/sql/enable.sql

@@ -34,6 +34,7 @@ INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `t
 ('bx_groups_view_profile', 1, 'bx_groups', '', '_bx_groups_page_block_title_entry_social_sharing', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_groups\";s:6:\"method\";s:21:\"entity_social_sharing\";}', 0, 0, 1, 0),
 ('bx_groups_view_profile', 1, 'bx_groups', '', '_bx_groups_page_block_title_entry_social_sharing', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_groups\";s:6:\"method\";s:21:\"entity_social_sharing\";}', 0, 0, 1, 0),
 ('bx_groups_view_profile', 2, 'bx_groups', '', '_bx_groups_page_block_title_profile_info', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_groups\";s:6:\"method\";s:11:\"entity_info\";}', 0, 0, 1, 0),
 ('bx_groups_view_profile', 2, 'bx_groups', '', '_bx_groups_page_block_title_profile_info', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_groups\";s:6:\"method\";s:11:\"entity_info\";}', 0, 0, 1, 0),
 ('bx_groups_view_profile', 3, 'bx_groups', '', '_bx_groups_page_block_title_fans', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_groups\";s:6:\"method\";s:4:\"fans\";}', 0, 0, 1, 0),
 ('bx_groups_view_profile', 3, 'bx_groups', '', '_bx_groups_page_block_title_fans', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_groups\";s:6:\"method\";s:4:\"fans\";}', 0, 0, 1, 0),
+('bx_groups_view_profile', 3, 'bx_groups', '', '_bx_groups_page_block_title_admins', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_groups\";s:6:\"method\";s:6:\"admins\";}', 0, 0, 1, 1),
 ('bx_groups_view_profile', 4, 'bx_groups', '', '_bx_groups_page_block_title_profile_description', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_groups\";s:6:\"method\";s:17:\"entity_text_block\";}', 0, 0, 1, 0);
 ('bx_groups_view_profile', 4, 'bx_groups', '', '_bx_groups_page_block_title_profile_description', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_groups\";s:6:\"method\";s:17:\"entity_text_block\";}', 0, 0, 1, 0);
 
 
 -- PAGE: view closed profile 
 -- PAGE: view closed profile 

+ 1 - 0
modules/boonex/russian/data/langs/bx_events/ru.xml

@@ -121,6 +121,7 @@
 	<string name="_bx_events_page_block_title_profile_friends_link"><![CDATA[<a href="{profile_link}">{display_name}</a> - друзья]]></string>
 	<string name="_bx_events_page_block_title_profile_friends_link"><![CDATA[<a href="{profile_link}">{display_name}</a> - друзья]]></string>
 	<string name="_bx_events_page_block_title_profile_friends"><![CDATA[Друзья]]></string>
 	<string name="_bx_events_page_block_title_profile_friends"><![CDATA[Друзья]]></string>
 	<string name="_bx_events_page_block_title_system_profile_friends"><![CDATA[Друзья]]></string>
 	<string name="_bx_events_page_block_title_system_profile_friends"><![CDATA[Друзья]]></string>
+	<string name="_bx_events_page_block_title_admins"><![CDATA[Администраторы]]></string>
 	<string name="_bx_events_page_block_title_fans_link"><![CDATA[Участники группы: <a href="{profile_link}">{display_name}</a>]]></string>
 	<string name="_bx_events_page_block_title_fans_link"><![CDATA[Участники группы: <a href="{profile_link}">{display_name}</a>]]></string>
     <string name="_bx_events_page_block_title_fans"><![CDATA[Участники]]></string>
     <string name="_bx_events_page_block_title_fans"><![CDATA[Участники]]></string>
 	<string name="_bx_events_page_block_title_system_fans"><![CDATA[Участники]]></string>
 	<string name="_bx_events_page_block_title_system_fans"><![CDATA[Участники]]></string>

+ 1 - 0
modules/boonex/russian/data/langs/bx_groups/ru.xml

@@ -97,6 +97,7 @@
 	<string name="_bx_groups_page_block_title_profile_friends_link"><![CDATA[<a href="{profile_link}">{display_name}</a> - Друзья]]></string>
 	<string name="_bx_groups_page_block_title_profile_friends_link"><![CDATA[<a href="{profile_link}">{display_name}</a> - Друзья]]></string>
 	<string name="_bx_groups_page_block_title_profile_friends"><![CDATA[Друзья]]></string>
 	<string name="_bx_groups_page_block_title_profile_friends"><![CDATA[Друзья]]></string>
 	<string name="_bx_groups_page_block_title_system_profile_friends"><![CDATA[Друзья]]></string>
 	<string name="_bx_groups_page_block_title_system_profile_friends"><![CDATA[Друзья]]></string>
+	<string name="_bx_groups_page_block_title_admins"><![CDATA[Администраторы]]></string>
 	<string name="_bx_groups_page_block_title_fans_link"><![CDATA[Участники группы: <a href="{profile_link}">{display_name}</a>]]></string>
 	<string name="_bx_groups_page_block_title_fans_link"><![CDATA[Участники группы: <a href="{profile_link}">{display_name}</a>]]></string>
 	<string name="_bx_groups_page_block_title_fans"><![CDATA[Участники]]></string>
 	<string name="_bx_groups_page_block_title_fans"><![CDATA[Участники]]></string>
 	<string name="_bx_groups_page_block_title_system_fans"><![CDATA[Участники]]></string>
 	<string name="_bx_groups_page_block_title_system_fans"><![CDATA[Участники]]></string>