Просмотр исходного кода

Merge branch 'master' of github.com:boonex/dolphin

Alex Trofimov 10 лет назад
Родитель
Сommit
6a4b85dc2b

+ 4 - 2
install/sql/system.sql

@@ -2781,7 +2781,7 @@ INSERT INTO `sys_objects_menu` (`object`, `title`, `set_name`, `module`, `templa
 ('sys_toolbar_member', '_sys_menu_title_toolbar_member', 'sys_toolbar_member', 'system', 5, 0, 1, 'BxTemplMenuToolbar', ''),
 ('sys_account', '_sys_menu_title_account', 'sys_account_links', 'system', 7, 0, 1, 'BxTemplMenuAccount', ''),
 ('sys_add_content', '_sys_menu_title_add_content', 'sys_add_content_links', 'system', 14, 0, 1, 'BxTemplMenuSite', ''),
-('sys_add_profile', '_sys_menu_title_add_profile', 'sys_add_profile_links', 'system', 6, 0, 1, '', ''),
+('sys_add_profile', '_sys_menu_title_add_profile', 'sys_add_profile_links', 'system', 14, 0, 1, '', ''),
 ('sys_account_dashboard_manage_tools', '_sys_menu_title_account_dashboard_manage_tools', 'sys_account_dashboard_manage_tools', 'system', 4, 0, 1, '', ''),
 ('sys_account_settings_submenu', '_sys_menu_title_account_settings', 'sys_account_settings', 'system', 8, 0, 1, '', ''),
 ('sys_account_settings_more', '_sys_menu_title_account_settings_more', 'sys_account_settings_more', 'system', 4, 0, 1, '', ''),
@@ -3412,7 +3412,9 @@ INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title_system`, `
 
 ('sys_account_settings_delete', 1, 'system', '', '_sys_page_block_title_account_settings_delete', 11, 2147483647, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:28:"account_settings_del_account";s:6:"params";a:0:{}s:5:"class";s:19:"TemplServiceAccount";}', 0, 1, 1),
 
-('sys_account_profile_switcher', 1, 'system', '', '_sys_page_block_title_account_profile_switcher', 11, 2147483647, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:24:"account_profile_switcher";s:6:"params";a:0:{}s:5:"class";s:20:"TemplServiceProfiles";}', 0, 1, 1),
+('sys_account_profile_switcher', 1, 'system', '', '_sys_page_block_title_account_profile_create', 11, 2147483647, 'menu', 'sys_add_profile', 0, 1, 1),
+
+('sys_account_profile_switcher', 1, 'system', '', '_sys_page_block_title_account_profile_switcher', 11, 2147483647, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:24:"account_profile_switcher";s:6:"params";a:0:{}s:5:"class";s:20:"TemplServiceProfiles";}', 0, 1, 2),
 
 ('sys_unsubscribe_notifications', 1, 'system', '', '_sys_page_block_title_unsubscribe_notifications', 11, 2147483647, 'service', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:25:"unsubscribe_notifications";s:6:"params";a:0:{}s:5:"class";s:19:"TemplServiceAccount";}', 0, 1, 1),
 

+ 3 - 2
modules/boonex/english/data/langs/system/en.xml

@@ -1961,6 +1961,7 @@ If it is not enabled then please consider implement this optimization, since it
     <string name="_sys_on"><![CDATA[on]]></string>
     <string name="_sys_off"><![CDATA[off]]></string>
 	<string name="_sys_page_block_title_about"><![CDATA[About]]></string>
+	<string name="_sys_page_block_title_account_profile_create"><![CDATA[Create a profile...]]></string>
 	<string name="_sys_page_block_title_account_profile_switcher"><![CDATA[Use site as ...]]></string>
 	<string name="_sys_page_block_title_account_settings_delete"><![CDATA[Delete Account]]></string>
 	<string name="_sys_page_block_title_account_settings_email"><![CDATA[Email Settings]]></string>
@@ -1991,7 +1992,7 @@ If it is not enabled then please consider implement this optimization, since it
 	<string name="_sys_page_lang_block_terms"><![CDATA[Our terms of use.]]></string>
 	<string name="_sys_page_lang_block_privacy"><![CDATA[Our privacy policy.]]></string>
 	<string name="_sys_page_title_about"><![CDATA[About]]></string>
-	<string name="_sys_page_title_account_profile_switcher"><![CDATA[Switch Profile]]></string>
+	<string name="_sys_page_title_account_profile_switcher"><![CDATA[My Profiles]]></string>
 	<string name="_sys_page_title_account_settings_delete"><![CDATA[Delete Account]]></string>
 	<string name="_sys_page_title_account_settings_email"><![CDATA[Email Settings]]></string>
 	<string name="_sys_page_title_account_settings_info"><![CDATA[Edit Account]]></string>
@@ -2006,7 +2007,7 @@ If it is not enabled then please consider implement this optimization, since it
 	<string name="_sys_page_title_privacy"><![CDATA[Privacy Policy]]></string>
 	<string name="_sys_page_title_terms"><![CDATA[Terms of Service]]></string>
 	<string name="_sys_page_title_system_about"><![CDATA[About]]></string>
-	<string name="_sys_page_title_system_account_profile_switcher"><![CDATA[Switch Profile]]></string>
+	<string name="_sys_page_title_system_account_profile_switcher"><![CDATA[My Profiles]]></string>
 	<string name="_sys_page_title_system_account_settings_delete"><![CDATA[Delete Account]]></string>
 	<string name="_sys_page_title_system_account_settings_email"><![CDATA[Email Settings]]></string>
 	<string name="_sys_page_title_system_account_settings_info"><![CDATA[Edit Account]]></string>

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

@@ -46,13 +46,6 @@ class BxOrgsSearchResult extends BxBaseModProfileSearchResult
                     'onField' => 'id',
                     'joinFields' => array(),
                 ),
-                'session' => array(
-                    'type' => 'INNER',
-                    'table' => 'sys_sessions',
-                    'mainField' => 'account_id',
-                    'onField' => 'user_id',
-                    'joinFields' => array('date'),
-                ),
             ),
             'paginate' => array('perPage' => 20, 'start' => 0),
             'sorting' => 'none',
@@ -111,6 +104,13 @@ class BxOrgsSearchResult extends BxBaseModProfileSearchResult
                 $this->aCurrent['title'] = _t('_bx_orgs_page_title_browse_online');
                 $this->aCurrent['restriction']['online']['value'] = time() - 60 * (int)getParam('sys_account_online_time');
                 $this->aCurrent['restriction_sql'] = ' AND `sys_accounts`.`profile_id`=`sys_profiles`.`id`';
+                $this->aCurrent['join']['session'] = array(
+                    'type' => 'INNER',
+                    'table' => 'sys_sessions',
+                    'mainField' => 'account_id',
+                    'onField' => 'user_id',
+                    'joinFields' => array('date'),
+                );
                 $this->aCurrent['sorting'] = 'online';
                 $this->sBrowseUrl = 'page.php?i=organizations-online';
                 break;

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

@@ -122,8 +122,8 @@
     <string name="_bx_orgs_menu_item_title_delete_account"><![CDATA[Delete Account]]></string>
     <string name="_bx_orgs_menu_item_title_system_profile_type"><![CDATA[Organization]]></string>
     <string name="_bx_orgs_menu_item_title_profile_type"><![CDATA[Organization]]></string>
-    <string name="_bx_orgs_menu_item_title_system_create_profile"><![CDATA[Create Organization]]></string>
-    <string name="_bx_orgs_menu_item_title_create_profile"><![CDATA[Create Organization]]></string>
+    <string name="_bx_orgs_menu_item_title_system_create_profile"><![CDATA[Organization]]></string>
+    <string name="_bx_orgs_menu_item_title_create_profile"><![CDATA[Organization]]></string>
     <string name="_bx_orgs_menu_item_title_system_view_profile_friends"><![CDATA[Friends]]></string>
     <string name="_bx_orgs_menu_item_title_view_profile_friends"><![CDATA[Friends]]></string>
     <string name="_bx_orgs_menu_item_title_system_view_profile_info"><![CDATA[Info]]></string>

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

@@ -153,7 +153,7 @@ INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `tit
 
 SET @iAddMenuOrder = (SELECT `order` FROM `sys_menu_items` WHERE `set_name` = 'sys_add_profile_links' AND `active` = 1 ORDER BY `order` DESC LIMIT 1);
 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 
-('sys_add_profile_links', 'bx_organizations', 'create-organization-profile', '_bx_orgs_menu_item_title_system_create_profile', '_bx_orgs_menu_item_title_create_profile', 'page.php?i=create-organization-profile', '', '', 'briefcase', '', 2147483647, 1, 1, IFNULL(@iAddMenuOrder, 0) + 1);
+('sys_add_profile_links', 'bx_organizations', 'create-organization-profile', '_bx_orgs_menu_item_title_system_create_profile', '_bx_orgs_menu_item_title_create_profile', 'page.php?i=create-organization-profile', '', '', 'briefcase col-red2', '', 2147483647, 1, 1, IFNULL(@iAddMenuOrder, 0) + 1);
 
 -- MENU: view actions
 

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

@@ -46,13 +46,6 @@ class BxPersonsSearchResult extends BxBaseModProfileSearchResult
                     'onField' => 'id',
                     'joinFields' => array(),
                 ),
-                'session' => array(
-                    'type' => 'INNER',
-                    'table' => 'sys_sessions',
-                    'mainField' => 'account_id',
-                    'onField' => 'user_id',
-                    'joinFields' => array('date'),
-                ),
             ),
             'paginate' => array('perPage' => 20, 'start' => 0),
             'sorting' => 'none',
@@ -111,6 +104,13 @@ class BxPersonsSearchResult extends BxBaseModProfileSearchResult
                 $this->aCurrent['title'] = _t('_bx_persons_page_title_browse_online');
                 $this->aCurrent['restriction']['online']['value'] = time() - 60 * (int)getParam('sys_account_online_time');
                 $this->aCurrent['restriction_sql'] = ' AND `sys_accounts`.`profile_id`=`sys_profiles`.`id`';
+                $this->aCurrent['join']['session'] = array(
+                    'type' => 'INNER',
+                    'table' => 'sys_sessions',
+                    'mainField' => 'account_id',
+                    'onField' => 'user_id',
+                    'joinFields' => array('date'),
+                );
                 $this->aCurrent['sorting'] = 'online';
                 $this->sBrowseUrl = 'page.php?i=persons-online';
                 break;

+ 2 - 2
modules/boonex/persons/install/langs/en.xml

@@ -118,8 +118,8 @@
     <string name="_bx_persons_menu_item_title_delete_account"><![CDATA[Delete Account]]></string>
     <string name="_bx_persons_menu_item_title_system_profile_type"><![CDATA[Person]]></string>
     <string name="_bx_persons_menu_item_title_profile_type"><![CDATA[Person]]></string>
-    <string name="_bx_persons_menu_item_title_system_create_profile"><![CDATA[Create Person]]></string>
-    <string name="_bx_persons_menu_item_title_create_profile"><![CDATA[Create Person]]></string>
+    <string name="_bx_persons_menu_item_title_system_create_profile"><![CDATA[Person]]></string>
+    <string name="_bx_persons_menu_item_title_create_profile"><![CDATA[Person]]></string>
     <string name="_bx_persons_menu_item_title_system_view_profile_friends"><![CDATA[Friends]]></string>
     <string name="_bx_persons_menu_item_title_view_profile_friends"><![CDATA[Friends]]></string>
     <string name="_bx_persons_menu_item_title_system_view_profile_info"><![CDATA[Info]]></string>

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

@@ -147,7 +147,7 @@ INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `tit
 
 SET @iAddMenuOrder = (SELECT `order` FROM `sys_menu_items` WHERE `set_name` = 'sys_add_profile_links' AND `active` = 1 ORDER BY `order` DESC LIMIT 1);
 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 
-('sys_add_profile_links', 'bx_persons', 'create-persons-profile', '_bx_persons_menu_item_title_system_create_profile', '_bx_persons_menu_item_title_create_profile', 'page.php?i=create-persons-profile', '', '', 'user', '', 2147483647, 1, 1, IFNULL(@iAddMenuOrder, 0) + 1);
+('sys_add_profile_links', 'bx_persons', 'create-persons-profile', '_bx_persons_menu_item_title_system_create_profile', '_bx_persons_menu_item_title_create_profile', 'page.php?i=create-persons-profile', '', '', 'user col-blue3', '', 2147483647, 1, 1, IFNULL(@iAddMenuOrder, 0) + 1);
 
 -- MENU: view actions
 

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

@@ -122,8 +122,8 @@
     <string name="_bx_orgs_menu_item_title_delete_account"><![CDATA[Удалить аккаунт]]></string>
     <string name="_bx_orgs_menu_item_title_system_profile_type"><![CDATA[Организация]]></string>
     <string name="_bx_orgs_menu_item_title_profile_type"><![CDATA[Организация]]></string>
-    <string name="_bx_orgs_menu_item_title_system_create_profile"><![CDATA[Создать организацию]]></string>
-    <string name="_bx_orgs_menu_item_title_create_profile"><![CDATA[Создать организацию]]></string>
+    <string name="_bx_orgs_menu_item_title_system_create_profile"><![CDATA[Организация]]></string>
+    <string name="_bx_orgs_menu_item_title_create_profile"><![CDATA[Организация]]></string>
     <string name="_bx_orgs_menu_item_title_system_view_profile_friends"><![CDATA[Друзья]]></string>
     <string name="_bx_orgs_menu_item_title_view_profile_friends"><![CDATA[Друзья]]></string>
     <string name="_bx_orgs_menu_item_title_system_view_profile_info"><![CDATA[Инфо]]></string>

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

@@ -118,8 +118,8 @@
     <string name="_bx_persons_menu_item_title_delete_account"><![CDATA[Удалить аккаунт]]></string>
     <string name="_bx_persons_menu_item_title_system_profile_type"><![CDATA[Персона]]></string>
     <string name="_bx_persons_menu_item_title_profile_type"><![CDATA[Персона]]></string>
-    <string name="_bx_persons_menu_item_title_system_create_profile"><![CDATA[Создать персону]]></string>
-    <string name="_bx_persons_menu_item_title_create_profile"><![CDATA[Создать персону]]></string>
+    <string name="_bx_persons_menu_item_title_system_create_profile"><![CDATA[Персона]]></string>
+    <string name="_bx_persons_menu_item_title_create_profile"><![CDATA[Персона]]></string>
     <string name="_bx_persons_menu_item_title_system_view_profile_friends"><![CDATA[Друзья]]></string>
     <string name="_bx_persons_menu_item_title_view_profile_friends"><![CDATA[Друзья]]></string>
     <string name="_bx_persons_menu_item_title_system_view_profile_info"><![CDATA[Инфо]]></string>

+ 3 - 2
modules/boonex/russian/data/langs/system/ru.xml

@@ -1961,6 +1961,7 @@
     <string name="_sys_on"><![CDATA[вкл.]]></string>
     <string name="_sys_off"><![CDATA[выкл.]]></string>
 	<string name="_sys_page_block_title_about"><![CDATA[Об...]]></string>
+	<string name="_sys_page_block_title_account_profile_create"><![CDATA[Создать профиль...]]></string>
 	<string name="_sys_page_block_title_account_profile_switcher"><![CDATA[Использовать сайт как ...]]></string>
 	<string name="_sys_page_block_title_account_settings_delete"><![CDATA[Удалить Аккаунт]]></string>
 	<string name="_sys_page_block_title_account_settings_email"><![CDATA[Имейл - Настройки]]></string>
@@ -1991,7 +1992,7 @@
 	<string name="_sys_page_lang_block_terms"><![CDATA[Правила пользования нашим сайтом.]]></string>
 	<string name="_sys_page_lang_block_privacy"><![CDATA[Политика конфиденциальности нашего сайта.]]></string>
 	<string name="_sys_page_title_about"><![CDATA[Об...]]></string>
-	<string name="_sys_page_title_account_profile_switcher"><![CDATA[Переключить Профиль]]></string>
+	<string name="_sys_page_title_account_profile_switcher"><![CDATA[Мои Профили]]></string>
 	<string name="_sys_page_title_account_settings_delete"><![CDATA[Удалить Аккаунт]]></string>
 	<string name="_sys_page_title_account_settings_email"><![CDATA[Имейл - Настройки]]></string>
 	<string name="_sys_page_title_account_settings_info"><![CDATA[Редактировать Аккаунт]]></string>
@@ -2006,7 +2007,7 @@
 	<string name="_sys_page_title_privacy"><![CDATA[Политика конфиденциальности]]></string>
 	<string name="_sys_page_title_terms"><![CDATA[Правила пользования]]></string>
 	<string name="_sys_page_title_system_about"><![CDATA[Об...]]></string>
-	<string name="_sys_page_title_system_account_profile_switcher"><![CDATA[Переключить Профиль]]></string>
+	<string name="_sys_page_title_system_account_profile_switcher"><![CDATA[Мои Профили]]></string>
 	<string name="_sys_page_title_system_account_settings_delete"><![CDATA[Удалить Аккаунт]]></string>
 	<string name="_sys_page_title_system_account_settings_email"><![CDATA[Имейл Настройки]]></string>
 	<string name="_sys_page_title_system_account_settings_info"><![CDATA[Редактировать Аккаунт]]></string>

+ 6 - 0
template/css/account.css

@@ -1,4 +1,10 @@
+/*-- My Prpfiles: Create Profile --*/
+.bx-menu-object-sys_add_profile {
+	text-align: center;
+}
+
 
+/*-- My Prpfiles: Switch Profile --*/
 .sys-profile-switch-row {
     margin-top:1px;
 }

+ 7 - 0
template/scripts/BxBasePageAccount.php

@@ -72,6 +72,13 @@ class BxBasePageAccount extends BxTemplPage
 
     }
 
+    public function getCode()
+    {
+		BxDolTemplate::getInstance()->addCss('account.css');
+
+    	return parent::getCode();
+    }
+
     protected function _getPageCacheParams ()
     {
         return getLoggedId(); // cache is different for every account

+ 0 - 10
template/scripts/BxBaseServiceProfiles.php

@@ -177,18 +177,8 @@ class BxBaseServiceProfiles extends BxDol
             );
         }
 
-        if (!$aVars['bx_repeat:row']) {
-            $oMenu = BxDolMenu::getObjectInstance('sys_add_profile');
-            return array(
-                'content' => $oMenu ? $oMenu->getCode() : MsgBox(_t('_sys_txt_empty')),
-                'menu' => 'sys_add_profile',
-            );
-        }
-
-        $oTemplate->addCss('account.css');
         return array(
             'content' => $oTemplate->parseHtmlByName('profile_switch_row.html', $aVars),
-            'menu' => 'sys_add_profile',
         );
     }