AntonLV 4 лет назад
Родитель
Сommit
ec99f323ae

+ 25 - 16
modules/base/text/classes/BxBaseModTextPageAuthor.php

@@ -31,24 +31,33 @@ class BxBaseModTextPageAuthor extends BxTemplPage
         if (!$this->_aProfileInfo || !$this->_oProfile)
             return;
 
-        //set cover
-        $sProfileModule = $this->_oProfile->getModule();
-        if(BxDolRequest::serviceExists($sProfileModule, 'set_view_profile_cover')) {
-            $aProfileInfoFull = BxDolService::call($sProfileModule, 'get_all', array(array('type' => 'id', 'id' => $this->_oProfile->getContentId())));
-
-            BxDolService::call($sProfileModule, 'set_view_profile_cover', array($this, $aProfileInfoFull));
+        if(bx_process_input(bx_get('owner'), BX_DATA_INT) == 1) {
+            // select item in Profile Stats menu
+            $oMenu = BxDolMenu::getObjectInstance('sys_profile_stats');
+            if($oMenu && isset($this->_aObject['module']) && ($oModuleContent = BxDolModule::getInstance($this->_aObject['module']))) {
+                $oMenu->setSelected($this->_aObject['module'], 'profile-stats-my-' . $oModuleContent->_oConfig->getUri());
+            }
         }
+        else {
+            //set cover
+            $sProfileModule = $this->_oProfile->getModule();
+            if(BxDolRequest::serviceExists($sProfileModule, 'set_view_profile_cover')) {
+                $aProfileInfoFull = BxDolService::call($sProfileModule, 'get_all', array(array('type' => 'id', 'id' => $this->_oProfile->getContentId())));
+
+                BxDolService::call($sProfileModule, 'set_view_profile_cover', array($this, $aProfileInfoFull));
+            }
 
-        // select view profile submenu
-        $oMenuSubmenu = BxDolMenu::getObjectInstance('sys_site_submenu');
-        if ($oMenuSubmenu) {
-            $sProfileObject = BxDolService::call($this->_oProfile->getModule(), 'get_submenu_object');
-            if ($sProfileObject)
-                $oMenuSubmenu->setObjectSubmenu($sProfileObject, array (
-                    'title' => $this->_oProfile->getDisplayName(),
-                    'link' => $this->_oProfile->getUrl(),
-                    'icon' => $this->_oProfile->getIconModule(),
-                ));
+            // select view profile submenu
+            $oMenuSubmenu = BxDolMenu::getObjectInstance('sys_site_submenu');
+            if ($oMenuSubmenu) {
+                $sProfileObject = BxDolService::call($this->_oProfile->getModule(), 'get_submenu_object');
+                if ($sProfileObject)
+                    $oMenuSubmenu->setObjectSubmenu($sProfileObject, array (
+                        'title' => $this->_oProfile->getDisplayName(),
+                        'link' => $this->_oProfile->getUrl(),
+                        'icon' => $this->_oProfile->getIconModule(),
+                    ));
+            }
         }
 
         // add replaceable markers

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

@@ -389,7 +389,7 @@ INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES
 
 -- MENU: profile stats
 INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `addon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES
-('sys_profile_stats', @sName, 'profile-stats-discussions', '_bx_forum_menu_item_title_system_discussions', '_bx_forum_menu_item_title_discussions', 'page.php?i=discussions-author&profile_id={member_id}', '', '', 'far comments col-blue2', 'a:2:{s:6:"module";s:8:"bx_forum";s:6:"method";s:19:"get_discussions_num";}', '', 2147483646, 1, 0, 2);
+('sys_profile_stats', @sName, 'profile-stats-my-forum', '_bx_forum_menu_item_title_system_discussions', '_bx_forum_menu_item_title_discussions', 'page.php?i=discussions-author&profile_id={member_id}', '', '', 'far comments col-blue2', 'a:2:{s:6:"module";s:8:"bx_forum";s:6:"method";s:19:"get_discussions_num";}', '', 2147483646, 1, 0, 2);
 
 -- MENU: dashboard manage tools
 SET @iManageMenuOrder = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_menu_items` WHERE `set_name`='sys_account_dashboard_manage_tools' LIMIT 1);

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

@@ -313,7 +313,7 @@ INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `titl
 -- MENU: profile stats
 SET @iNotifMenuOrder = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_menu_items` WHERE `set_name` = 'sys_profile_stats' AND `active` = 1 LIMIT 1);
 INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `addon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES
-('sys_profile_stats', 'bx_glossary', 'profile-stats-my-glossary', '_bx_glossary_menu_item_title_system_manage_my_glossary', '_bx_glossary_menu_item_title_manage_my_glossary', 'page.php?i=glossary-author&profile_id={member_id}', '', '_self', 'fa-book col-red3', 'a:2:{s:6:"module";s:11:"bx_glossary";s:6:"method";s:41:"get_menu_addon_manage_tools_profile_stats";}', '', @iAdministratorModeratorAccess, 1, 0, @iNotifMenuOrder + 1);
+('sys_profile_stats', 'bx_glossary', 'profile-stats-my-glossary', '_bx_glossary_menu_item_title_system_manage_my_glossary', '_bx_glossary_menu_item_title_manage_my_glossary', 'page.php?i=glossary-author&profile_id={member_id}', '', '_self', 'fa-book col-red3', 'a:2:{s:6:"module";s:11:"bx_glossary";s:6:"method";s:41:"get_menu_addon_manage_tools_profile_stats";}', '', 2147483646, 1, 0, @iNotifMenuOrder + 1);
 
 -- MENU: manage tools submenu
 INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 

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

@@ -403,7 +403,7 @@ INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `titl
 -- MENU: profile stats
 SET @iNotifMenuOrder = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_menu_items` WHERE `set_name` = 'sys_profile_stats' AND `active` = 1 LIMIT 1);
 INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `addon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES
-('sys_profile_stats', 'bx_market', 'profile-stats-my-products', '_bx_market_menu_item_title_system_manage_my_products', '_bx_market_menu_item_title_manage_my_products', 'page.php?i=products-author&profile_id={member_id}', '', '_self', 'shopping-cart col-green3', 'a:2:{s:6:"module";s:9:"bx_market";s:6:"method";s:41:"get_menu_addon_manage_tools_profile_stats";}', '', 2147483646, 1, 0, @iNotifMenuOrder + 1);
+('sys_profile_stats', 'bx_market', 'profile-stats-my-market', '_bx_market_menu_item_title_system_manage_my_products', '_bx_market_menu_item_title_manage_my_products', 'page.php?i=products-author&profile_id={member_id}', '', '_self', 'shopping-cart col-green3', 'a:2:{s:6:"module";s:9:"bx_market";s:6:"method";s:41:"get_menu_addon_manage_tools_profile_stats";}', '', 2147483646, 1, 0, @iNotifMenuOrder + 1);
 
 -- MENU: manage tools submenu
 INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 

+ 5 - 1
plugins_public/tailwind/css/tailwind.css

@@ -514,7 +514,6 @@
         @apply opacity-100 ring-0 bg-gray-50 dark:bg-gray-700 shadow-none;
     }
 
-
     /* Page Submenu */
     .bx-artificer .bx-menu-main-submenu .bx-menu-item.bx-menu-tab-active a {
         @apply text-gray-900 dark:text-gray-100;
@@ -523,6 +522,11 @@
         @apply bg-blue-500 group-hover:bg-blue-500;
     }
 
+    /* Profile Stats menu */
+    .bx-artificer .bx-menu-profile-stats.bx-menu-ver li.bx-menu-tab-active {
+        @apply bg-white dark:bg-gray-900 ring-1 ring-gray-200 dark:ring-gray-800 text-gray-900 dark:text-white;
+    }
+
     /* Profile Cover Actions */
     .bx-artificer .bx-base-pofile-cover-actions div.bx-base-general-entity-actions .bx-menu-custom-hor.bx-menu-hor-inline li.bx-mi-primary {
         @apply border-transparent text-gray-200 hover:text-white bg-blue-600 hover:bg-blue-700 focus:ring-blue-500;

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
plugins_public/tailwind/css/tailwind.min.css


+ 10 - 0
template/scripts/BxBaseMenuProfileStats.php

@@ -100,6 +100,16 @@ class BxBaseMenuProfileStats extends BxTemplMenuAccountNotifications
 
         return $aResult;
     }
+    
+    protected function _getMenuItem($a)
+    {
+        if(isset($a['link']))
+            $a['link'] = bx_append_url_params($a['link'], [
+                'owner' => 1
+            ]);
+
+        return parent::_getMenuItem($a);
+    }
 }
 
 /** @} */

Некоторые файлы не были показаны из-за большого количества измененных файлов