Procházet zdrojové kódy

Ticket #255 - Clean up: Online pages in Profile based modules.

AntonLV před 10 roky
rodič
revize
8b7967836f

+ 5 - 0
modules/base/profile/classes/BxBaseModProfileModule.php

@@ -191,6 +191,11 @@ class BxBaseModProfileModule extends BxBaseModGeneralModule implements iBxDolPro
         return $this->_serviceBrowse ('active', false, BX_DB_PADDING_DEF, $bDisplayEmptyMsg);
     }
 
+	public function serviceBrowseOnlineProfiles ($bDisplayEmptyMsg = false)
+    {
+        return $this->_serviceBrowse ('online', false, BX_DB_PADDING_DEF, $bDisplayEmptyMsg);
+    }
+
     public function serviceBrowseConnections ($iProfileId, $sObjectConnections = 'sys_profiles_friends', $sConnectionsType = 'content', $iMutual = false, $iDesignBox = BX_DB_PADDING_DEF, $iProfileId2 = 0)
     {
         return $this->_serviceBrowse (

+ 7 - 0
modules/boonex/organizations/classes/BxOrgsSearchResult.php

@@ -96,6 +96,13 @@ class BxOrgsSearchResult extends BxBaseModProfileSearchResult
                 $this->aCurrent['title'] = _t('_bx_orgs_page_title_browse_active');
                 $this->aCurrent['sorting'] = 'active';
                 $this->sBrowseUrl = 'page.php?i=organizations-active';
+                break;
+
+			case 'online':
+                $this->aCurrent['rss']['link'] = 'modules/?r=orgs/rss/' . $sMode;
+                $this->aCurrent['title'] = _t('_bx_orgs_page_title_browse_online');
+                $this->aCurrent['sorting'] = 'active';
+                $this->sBrowseUrl = 'page.php?i=organizations-online';
                 break;
 
             case '': // search results

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

@@ -54,6 +54,7 @@
 	<string name="_bx_orgs_page_title_view_profile"><![CDATA[{display_name}]]></string>
 	<string name="_bx_orgs_page_title_browse"><![CDATA[Organizations]]></string>
 	<string name="_bx_orgs_page_title_browse_active"><![CDATA[Active Organizations]]></string>
+	<string name="_bx_orgs_page_title_browse_online"><![CDATA[Online Organizations]]></string>
 	<string name="_bx_orgs_page_title_browse_recent"><![CDATA[New Organizations]]></string>
 	<string name="_bx_orgs_page_title_browse_connections"><![CDATA[{0} connections]]></string>
 	<string name="_bx_orgs_page_title_browse_connections_mutual"><![CDATA[{0} and {1} mutual connections]]></string>
@@ -68,6 +69,8 @@
 	<string name="_bx_orgs_page_title_manage"><![CDATA[Manage Organizations]]></string>
 	<string name="_bx_orgs_page_title_sys_active"><![CDATA[Active Organizations]]></string>
 	<string name="_bx_orgs_page_title_active"><![CDATA[Active Organizations]]></string>
+	<string name="_bx_orgs_page_title_sys_online"><![CDATA[Online Organizations]]></string>
+	<string name="_bx_orgs_page_title_online"><![CDATA[Online Organizations]]></string>
 
 	<string name="_bx_orgs_page_block_title_create_profile"><![CDATA[Create Organization's Profile]]></string>
 	<string name="_bx_orgs_page_block_title_edit_profile"><![CDATA[Edit Profile]]></string>
@@ -88,6 +91,7 @@
 	<string name="_bx_orgs_page_block_title_system_manage_administration"><![CDATA[Manage All Organizations]]></string>
 	<string name="_bx_orgs_page_block_title_manage"><![CDATA[Manage Organizations]]></string>
     <string name="_bx_orgs_page_block_title_active_profiles"><![CDATA[Active Organizations]]></string>
+    <string name="_bx_orgs_page_block_title_online_profiles"><![CDATA[Online Organizations]]></string>
 
     <string name="_bx_orgs_page_block_title_categories"><![CDATA[Organization categories]]></string>
 
@@ -156,6 +160,8 @@
 	<string name="_bx_orgs_menu_item_title_manage_all"><![CDATA[All Organizations]]></string>
 	<string name="_bx_orgs_menu_item_title_system_entries_active"><![CDATA[Active]]></string>
 	<string name="_bx_orgs_menu_item_title_entries_active"><![CDATA[Active]]></string>
+	<string name="_bx_orgs_menu_item_title_system_entries_online"><![CDATA[Online]]></string>
+	<string name="_bx_orgs_menu_item_title_entries_online"><![CDATA[Online]]></string>
 
 	<string name="_bx_orgs_grid_filter_item_title_adm_select_one_filter1"><![CDATA[All Statuses]]></string>
 	<string name="_bx_orgs_grid_filter_item_title_adm_active"><![CDATA[Active]]></string>

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

@@ -94,6 +94,14 @@ INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `lay
 INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
 ('bx_organizations_active', 1, 'bx_organizations', '_bx_orgs_page_block_title_active_profiles', 11, 2147483647, 'service', 'a:3:{s:6:\"module\";s:16:\"bx_organizations\";s:6:\"method\";s:22:\"browse_active_profiles\";s:6:"params";a:1:{i:0;b:1;}}', 0, 1, 0);
 
+-- PAGE: online profiles
+
+INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_organizations_online', '_bx_orgs_page_title_sys_online', '_bx_orgs_page_title_online', 'bx_organizations', 5, 2147483647, 1, 'organizations-online', 'page.php?i=organizations-online', '', '', '', 0, 1, 0, 'BxOrgsPageBrowse', 'modules/boonex/organizations/classes/BxOrgsPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_organizations_online', 1, 'bx_organizations', '_bx_orgs_page_block_title_online_profiles', 11, 2147483647, 'service', 'a:3:{s:6:\"module\";s:16:\"bx_organizations\";s:6:\"method\";s:22:\"browse_online_profiles\";s:6:"params";a:1:{i:0;b:1;}}', 0, 1, 0);
+
 -- PAGE: module manage own
 INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
 ('bx_organizations_manage', '_bx_orgs_page_title_sys_manage', '_bx_orgs_page_title_manage', 'bx_organizations', 5, 2147483647, 1, 'organizations-manage', 'page.php?i=organizations-manage', '', '', '', 0, 1, 0, 'BxOrgsPageBrowse', 'modules/boonex/organizations/classes/BxOrgsPageBrowse.php');
@@ -182,7 +190,8 @@ INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES
 INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
 ('bx_organizations_submenu', 'bx_organizations', 'organizations-home', '_bx_orgs_menu_item_title_system_entries_recent', '_bx_orgs_menu_item_title_entries_recent', 'page.php?i=organizations-home', '', '', '', '', 2147483647, 1, 1, 1),
 ('bx_organizations_submenu', 'bx_organizations', 'organizations-active', '_bx_orgs_menu_item_title_system_entries_active', '_bx_orgs_menu_item_title_entries_active', 'page.php?i=organizations-active', '', '', '', '', 2147483647, 1, 1, 2),
-('bx_organizations_submenu', 'bx_organizations', 'organizations-manage', '_bx_orgs_menu_item_title_system_entries_manage', '_bx_orgs_menu_item_title_entries_manage', 'page.php?i=organizations-manage', '', '', '', '', 2147483646, 1, 1, 3);
+('bx_organizations_submenu', 'bx_organizations', 'organizations-online', '_bx_orgs_menu_item_title_system_entries_online', '_bx_orgs_menu_item_title_entries_online', 'page.php?i=organizations-online', '', '', '', '', 2147483647, 1, 1, 3),
+('bx_organizations_submenu', 'bx_organizations', 'organizations-manage', '_bx_orgs_menu_item_title_system_entries_manage', '_bx_orgs_menu_item_title_entries_manage', 'page.php?i=organizations-manage', '', '', '', '', 2147483646, 1, 1, 4);
 
 -- MENU: view submenu
 

+ 7 - 0
modules/boonex/persons/classes/BxPersonsSearchResult.php

@@ -96,6 +96,13 @@ class BxPersonsSearchResult extends BxBaseModProfileSearchResult
                 $this->aCurrent['title'] = _t('_bx_persons_page_title_browse_active');
                 $this->aCurrent['sorting'] = 'active';
                 $this->sBrowseUrl = 'page.php?i=persons-active';
+                break;
+
+			case 'online':
+                $this->aCurrent['rss']['link'] = 'modules/?r=persons/rss/' . $sMode;
+                $this->aCurrent['title'] = _t('_bx_persons_page_title_browse_online');
+                $this->aCurrent['sorting'] = 'active';
+                $this->sBrowseUrl = 'page.php?i=persons-online';
                 break;
 
             case '': // search results

+ 6 - 0
modules/boonex/persons/install/langs/en.xml

@@ -51,6 +51,7 @@
 	<string name="_bx_persons_page_title_view_profile"><![CDATA[{display_name}]]></string>
 	<string name="_bx_persons_page_title_browse"><![CDATA[People]]></string>
 	<string name="_bx_persons_page_title_browse_active"><![CDATA[Active People]]></string>
+	<string name="_bx_persons_page_title_browse_online"><![CDATA[Online People]]></string>
 	<string name="_bx_persons_page_title_browse_recent"><![CDATA[New People]]></string>
 	<string name="_bx_persons_page_title_browse_connections"><![CDATA[{0} connections]]></string>
 	<string name="_bx_persons_page_title_browse_connections_mutual"><![CDATA[{0} and {1} mutual connections]]></string>
@@ -65,6 +66,8 @@
 	<string name="_bx_persons_page_title_manage"><![CDATA[Manage People]]></string>
 	<string name="_bx_persons_page_title_sys_active"><![CDATA[Active People]]></string>
 	<string name="_bx_persons_page_title_active"><![CDATA[Active People]]></string>
+	<string name="_bx_persons_page_title_sys_online"><![CDATA[Online People]]></string>
+	<string name="_bx_persons_page_title_online"><![CDATA[Online People]]></string>
 
 	<string name="_bx_persons_page_block_title_create_profile"><![CDATA[Create Person's Profile]]></string>
 	<string name="_bx_persons_page_block_title_edit_profile"><![CDATA[Edit Profile]]></string>
@@ -85,6 +88,7 @@
 	<string name="_bx_persons_page_block_title_system_manage_administration"><![CDATA[Manage All People]]></string>
 	<string name="_bx_persons_page_block_title_manage"><![CDATA[Manage People]]></string>
 	<string name="_bx_persons_page_block_title_active_profiles"><![CDATA[Active People]]></string>
+	<string name="_bx_persons_page_block_title_online_profiles"><![CDATA[Online People]]></string>
 
     <string name="_bx_persons_menu_title_submenu"><![CDATA[Persons Submenu]]></string>
     <string name="_bx_persons_menu_set_title_submenu"><![CDATA[Persons Submenu]]></string>
@@ -151,6 +155,8 @@
 	<string name="_bx_persons_menu_item_title_manage_all"><![CDATA[All Profiles]]></string>   
 	<string name="_bx_persons_menu_item_title_system_entries_active"><![CDATA[Active]]></string>
 	<string name="_bx_persons_menu_item_title_entries_active"><![CDATA[Active]]></string>
+	<string name="_bx_persons_menu_item_title_system_entries_online"><![CDATA[Online]]></string>
+	<string name="_bx_persons_menu_item_title_entries_online"><![CDATA[Online]]></string>
 
 	<string name="_bx_persons_grid_filter_item_title_adm_select_one_filter1"><![CDATA[All Statuses]]></string>
 	<string name="_bx_persons_grid_filter_item_title_adm_active"><![CDATA[Active]]></string>

+ 9 - 1
modules/boonex/persons/install/sql/enable.sql

@@ -94,6 +94,13 @@ INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `lay
 INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
 ('bx_persons_active', 1, 'bx_persons', '_bx_persons_page_block_title_active_profiles', 11, 2147483647, 'service', 'a:3:{s:6:\"module\";s:10:\"bx_persons\";s:6:\"method\";s:22:\"browse_active_profiles\";s:6:"params";a:1:{i:0;b:1;}}', 0, 1, 0);
 
+-- PAGE: online profiles
+INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_persons_online', '_bx_persons_page_title_sys_online', '_bx_persons_page_title_online', 'bx_persons', 5, 2147483647, 1, 'persons-online', 'page.php?i=persons-online', '', '', '', 0, 1, 0, 'BxPersonsPageBrowse', 'modules/boonex/persons/classes/BxPersonsPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_persons_online', 1, 'bx_persons', '_bx_persons_page_block_title_online_profiles', 11, 2147483647, 'service', 'a:3:{s:6:\"module\";s:10:\"bx_persons\";s:6:\"method\";s:22:\"browse_online_profiles\";s:6:"params";a:1:{i:0;b:1;}}', 0, 1, 0);
+
 -- PAGE: module manage own
 INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
 ('bx_persons_manage', '_bx_persons_page_title_sys_manage', '_bx_persons_page_title_manage', 'bx_persons', 5, 2147483647, 1, 'persons-manage', 'page.php?i=persons-manage', '', '', '', 0, 1, 0, 'BxPersonsPageBrowse', 'modules/boonex/persons/classes/BxPersonsPageBrowse.php');
@@ -177,7 +184,8 @@ INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES
 INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
 ('bx_persons_submenu', 'bx_persons', 'persons-home', '_bx_persons_menu_item_title_system_entries_recent', '_bx_persons_menu_item_title_entries_recent', 'page.php?i=persons-home', '', '', '', '', 2147483647, 1, 1, 1),
 ('bx_persons_submenu', 'bx_persons', 'persons-active', '_bx_persons_menu_item_title_system_entries_active', '_bx_persons_menu_item_title_entries_active', 'page.php?i=persons-active', '', '', '', '', 2147483647, 1, 1, 2),
-('bx_persons_submenu', 'bx_persons', 'persons-manage', '_bx_persons_menu_item_title_system_entries_manage', '_bx_persons_menu_item_title_entries_manage', 'page.php?i=persons-manage', '', '', '', '', 2147483646, 1, 1, 3);
+('bx_persons_submenu', 'bx_persons', 'persons-online', '_bx_persons_menu_item_title_system_entries_online', '_bx_persons_menu_item_title_entries_online', 'page.php?i=persons-online', '', '', '', '', 2147483647, 1, 1, 3),
+('bx_persons_submenu', 'bx_persons', 'persons-manage', '_bx_persons_menu_item_title_system_entries_manage', '_bx_persons_menu_item_title_entries_manage', 'page.php?i=persons-manage', '', '', '', '', 2147483646, 1, 1, 4);
 
 -- MENU: view submenu
 

+ 8 - 1
modules/boonex/russian/data/langs/bx_organizations/ru.xml

@@ -54,6 +54,7 @@
 	<string name="_bx_orgs_page_title_view_profile"><![CDATA[{display_name}]]></string>
 	<string name="_bx_orgs_page_title_browse"><![CDATA[Организации]]></string>
     <string name="_bx_orgs_page_title_browse_active"><![CDATA[Последние Активные Организации]]></string>
+    <string name="_bx_orgs_page_title_browse_online"><![CDATA[Онлайн Организации]]></string>
 	<string name="_bx_orgs_page_title_browse_recent"><![CDATA[Последние Добавленные Организации]]></string>
 	<string name="_bx_orgs_page_title_browse_connections"><![CDATA[{0} связей]]></string>
 	<string name="_bx_orgs_page_title_browse_connections_mutual"><![CDATA[{0} и {1} обоюдных связей]]></string>
@@ -68,7 +69,8 @@
 	<string name="_bx_orgs_page_title_manage"><![CDATA[Управление организациями]]></string>
 	<string name="_bx_orgs_page_title_sys_active"><![CDATA[Последние Активные Организации]]></string>
 	<string name="_bx_orgs_page_title_active"><![CDATA[Последние Активные Организации]]></string>
-    <string name="_bx_orgs_page_block_title_categories"><![CDATA[Категории организаций]]></string>
+	<string name="_bx_orgs_page_title_sys_online"><![CDATA[Онлайн Организации]]></string>
+	<string name="_bx_orgs_page_title_online"><![CDATA[Онлайн Организации]]></string>
 
 	<string name="_bx_orgs_page_block_title_create_profile"><![CDATA[Создать профиль организации]]></string>
 	<string name="_bx_orgs_page_block_title_edit_profile"><![CDATA[Редактировать профиль]]></string>
@@ -89,6 +91,9 @@
 	<string name="_bx_orgs_page_block_title_system_manage_administration"><![CDATA[Управление всеми организациями]]></string>
 	<string name="_bx_orgs_page_block_title_manage"><![CDATA[Управление организациями]]></string>
     <string name="_bx_orgs_page_block_title_active_profiles"><![CDATA[Последние Активные Организации]]></string>
+    <string name="_bx_orgs_page_block_title_online_profiles"><![CDATA[Онлайн Организации]]></string>
+
+	<string name="_bx_orgs_page_block_title_categories"><![CDATA[Категории организаций]]></string>
 
     <string name="_bx_orgs_menu_title_submenu"><![CDATA[Организации - Подменю]]></string>
     <string name="_bx_orgs_menu_set_title_submenu"><![CDATA[Организации - Подменю]]></string>
@@ -155,6 +160,8 @@
 	<string name="_bx_orgs_menu_item_title_manage_all"><![CDATA[Все организации]]></string>
 	<string name="_bx_orgs_menu_item_title_system_entries_active"><![CDATA[Активные Организации]]></string>
 	<string name="_bx_orgs_menu_item_title_entries_active"><![CDATA[Активные Организации]]></string>
+	<string name="_bx_orgs_menu_item_title_system_entries_online"><![CDATA[Онлайн]]></string>
+	<string name="_bx_orgs_menu_item_title_entries_online"><![CDATA[Онлайн]]></string>
 
 	<string name="_bx_orgs_grid_filter_item_title_adm_select_one_filter1"><![CDATA[Все статусы]]></string>
 	<string name="_bx_orgs_grid_filter_item_title_adm_active"><![CDATA[Активные]]></string>

+ 6 - 0
modules/boonex/russian/data/langs/bx_persons/ru.xml

@@ -51,6 +51,7 @@
 	<string name="_bx_persons_page_title_view_profile"><![CDATA[{display_name}]]></string>
 	<string name="_bx_persons_page_title_browse"><![CDATA[Люди]]></string>
 	<string name="_bx_persons_page_title_browse_active"><![CDATA[Последние Активные Пользователи]]></string>
+	<string name="_bx_persons_page_title_browse_online"><![CDATA[Онлайн Пользователи]]></string>
 	<string name="_bx_persons_page_title_browse_recent"><![CDATA[Последние Присоединившиеся Пользователи]]></string>
 	<string name="_bx_persons_page_title_browse_connections"><![CDATA[{0} связей]]></string>
 	<string name="_bx_persons_page_title_browse_connections_mutual"><![CDATA[{0} и {1} обоюдных связей]]></string>
@@ -65,6 +66,8 @@
 	<string name="_bx_persons_page_title_manage"><![CDATA[Управление профилями]]></string>
 	<string name="_bx_persons_page_title_sys_active"><![CDATA[Последние Активные Пользователи]]></string>
 	<string name="_bx_persons_page_title_active"><![CDATA[Последние Активные Пользователи]]></string>
+	<string name="_bx_persons_page_title_sys_online"><![CDATA[Онлайн Пользователи]]></string>
+	<string name="_bx_persons_page_title_online"><![CDATA[Онлайн Пользователи]]></string>
 
 	<string name="_bx_persons_page_block_title_create_profile"><![CDATA[Создать персональный профиль]]></string>
 	<string name="_bx_persons_page_block_title_edit_profile"><![CDATA[Редактировать профиль]]></string>
@@ -85,6 +88,7 @@
 	<string name="_bx_persons_page_block_title_system_manage_administration"><![CDATA[Управление всеми профилями]]></string>
 	<string name="_bx_persons_page_block_title_manage"><![CDATA[Управление профилями]]></string>
     <string name="_bx_persons_page_block_title_active_profiles"><![CDATA[Последние Активные Пользователи]]></string>
+    <string name="_bx_persons_page_block_title_online_profiles"><![CDATA[Онлайн Пользователи]]></string>
 
     <string name="_bx_persons_menu_title_submenu"><![CDATA[Персоны - Подменю]]></string>
     <string name="_bx_persons_menu_set_title_submenu"><![CDATA[Персоны - Подменю]]></string>
@@ -152,6 +156,8 @@
 	<string name="_bx_persons_menu_item_title_manage_all"><![CDATA[Все профили]]></string>   
 	<string name="_bx_persons_menu_item_title_system_entries_active"><![CDATA[Активные профили]]></string>
 	<string name="_bx_persons_menu_item_title_entries_active"><![CDATA[Активные профили]]></string>
+	<string name="_bx_persons_menu_item_title_system_entries_online"><![CDATA[Онлайн]]></string>
+	<string name="_bx_persons_menu_item_title_entries_online"><![CDATA[Онлайн]]></string>
 
 	<string name="_bx_persons_grid_filter_item_title_adm_select_one_filter1"><![CDATA[Все статусы]]></string>
 	<string name="_bx_persons_grid_filter_item_title_adm_active"><![CDATA[Активные]]></string>