Răsfoiți Sursa

#27 persons actions menu

Alex Trofimov 13 ani în urmă
părinte
comite
06cb3fc753

+ 3 - 0
inc/classes/BxDolConnection.php

@@ -167,6 +167,9 @@ class BxDolConnection extends BxDol implements iBxDolFactoryObject {
      * @return array
      */ 
     public function actionRemove () {
+        $a = $this->actionReject();
+        if (false == $a['err'])
+            return $a;
         return $this->_action ('removeConnection', '_sys_conn_err_connection_does_not_exists', false);
     }
 

+ 5 - 0
inc/classes/BxDolPageQuery.php

@@ -47,6 +47,11 @@ class BxDolPageQuery extends BxDolDb {
         return $aRet;
     }
 
+    public function getPageBlock($iBlockId) {
+        $sQuery = $this->prepare("SELECT * FROM `sys_pages_blocks` WHERE `object` = ? AND `id` = ?", $this->_aObject['object'], $iBlockId);
+        return $this->getRow($sQuery);
+    }
+
     public function getPageBlockContent($iId) {
         $sQuery = $this->prepare("SELECT `content` FROM `sys_pages_blocks` WHERE `id` = ?", $iId);
         return $this->getOne($sQuery);

+ 62 - 11
inc/js/functions.js

@@ -63,13 +63,29 @@ function getHtmlData( elem, url, callback, method , confirmation)
     }
 }
 
-
-function loadDynamicBlock( iBlockID, sUrl ) {
-    if( $ == undefined )
+/**
+ * This function reloads page block automatically, 
+ * just provide any element inside the block and this function will reload the block.
+ * @param e - element inside the block
+ * @return true on success, or false on error - particularly, if block isn't found
+ */
+function loadDynamicBlockAuto(e) {
+    var sUrl = location.href;
+    var sId = $(e).parents('.bx-page-block-container:first').attr('id');
+    
+    if (!sId || !sId.length)
         return false;
 
-    getHtmlData($('#page_block_' + iBlockID), (sUrl + '&dynamic=tab&pageBlock=' + iBlockID));
+    var aMatches = sId.match(/\-(\d+)$/);
+    if (!aMatches || !aMatches[1])
+        return false;
+        
+    loadDynamicBlock(parseInt(aMatches[1]), sUrl);
+    return true;
+}
 
+function loadDynamicBlock(iBlockID, sUrl) {
+    getHtmlData($('#bx-page-block-' + iBlockID), bx_append_url_params(sUrl, 'dynamic=tab&pageBlock=' + iBlockID));
     return true;
 }
 
@@ -147,6 +163,10 @@ function showPopupAnyHtml(sUrl, sId) {
 
 function bx_loading_btn (e, b) {
     e = $(e);
+
+    if (e.children('div').size())
+        e = e.children('div').first();
+
     if (!b) {
         e.find('.bx-loading-ajax-btn').remove();
     } else if (!e.find('.bx-loading-ajax-btn').length) {
@@ -246,12 +266,15 @@ function bx_center_content (sSel, sBlockStyle) {
 
 /**
  * Show pointer popup with menu from URL.
- * @param e - element to show popup at
  * @param o - menu object name
+ * @param e - element to show popup at
+ * @param options - popup options
+ * @param vars - additional GET variables
  */
-function bx_menu_popup (o, e, options) {
+function bx_menu_popup (o, e, options, vars) {
     var options = options || {};
-    var o = $.extend({}, $.fn.dolPopupDefaultOptions, options, {id: o, url: 'menu.php?o=' + o});
+    var vars = vars || {};
+    var o = $.extend({}, $.fn.dolPopupDefaultOptions, options, {id: o, url: bx_append_url_params('menu.php', $.extend({o:o}, vars))});
     $(e).dolPopupAjax(o);
 }
 
@@ -351,7 +374,7 @@ function bx_time(sLang, isAutoupdate, sRootSel) {
  * @param iContentId - content id, initiator is always current logged in user
  * @param bConfirm - show confirmation dialog
  */
-function bx_conn_action(sObj, sAction, iContentId, bConfirm) {
+function bx_conn_action(e, sObj, sAction, iContentId, bConfirm) {
     if ('undefined' != typeof(bConfirm) && bConfirm && !confirm(_t('_are you sure?')))
         return;
                 
@@ -361,13 +384,21 @@ function bx_conn_action(sObj, sAction, iContentId, bConfirm) {
         id: iContentId
     };
     var fCallback = function (data) {
+        bx_loading_btn(e, 0);
         if ('object' != typeof(data))
             return;
-        if (data.err)
+        if (data.err) {
             alert(data.msg);
-        else
-            location.reload();
+        } else {
+            if (!loadDynamicBlockAuto(e))
+                location.reload();
+            else
+                $('#bx-popup-ajax-wrapper-bx_persons_view_actions_more').remove();
+        }
     };
+
+    bx_loading_btn(e, 1);
+
     $.ajax({
         dataType: 'json',
         url: sUrlRoot + 'conn.php',
@@ -376,3 +407,23 @@ function bx_conn_action(sObj, sAction, iContentId, bConfirm) {
         success: fCallback
     });
 }
+
+function bx_append_url_params (sUrl, mixedParams) {
+    var sParams = sUrl.indexOf('?') == -1 ? '?' : '&';
+
+    if(mixedParams instanceof Array) {
+    	for(var i in mixedParams)
+            sParams += i + '=' + mixedParams[i] + '&';
+        sParams = sParams.substr(0, sParams.length-1);
+    }
+    else if(mixedParams instanceof Object) {
+    	$.each(mixedParams, function(sKey, sValue) {
+    		sParams += sKey + '=' + sValue + '&';
+    	});
+        sParams = sParams.substr(0, sParams.length-1);
+    }
+    else
+        sParams += mixedParams;
+
+    return sUrl + sParams;
+}

+ 27 - 3
modules/boonex/persons/classes/BxPersonsMenuViewPerson.php

@@ -11,6 +11,7 @@
 
 bx_import('BxTemplMenu');
 bx_import('BxDolProfile');
+bx_import('BxDolModule');
 
 /**
  * 'View person' menu.
@@ -40,6 +41,26 @@ class BxPersonsMenuViewPerson extends BxTemplMenu {
 
             $this->addMarkers($this->_aProfileInfo);
             $this->addMarkers(array('profile_id' => $this->_oProfile->id()));
+
+            if (isLogged()) {
+                bx_import('BxDolConnection');
+                $oConn = BxDolConnection::getObjectInstance('sys_profiles_friends');
+                if ($oConn->isConnectedNotMutual(bx_get_logged_profile_id(), $this->_oProfile->id()))
+                    $this->addMarkers(array(
+                        'title_add_friend' => _t('_bx_persons_menu_item_title_befriend_sent'), 
+                        'title_remove_friend' => _t('_bx_persons_menu_item_title_unfriend_cancel_request'),
+                    ));
+                elseif ($oConn->isConnectedNotMutual($this->_oProfile->id(), bx_get_logged_profile_id()))
+                    $this->addMarkers(array(
+                        'title_add_friend' => _t('_bx_persons_menu_item_title_befriend_confirm'),
+                        'title_remove_friend' => _t('_bx_persons_menu_item_title_unfriend_reject_request'),
+                    ));
+                else
+                    $this->addMarkers(array(
+                        'title_add_friend' => _t('_bx_persons_menu_item_title_befriend'),
+                        'title_remove_friend' => _t('_bx_persons_menu_item_title_unfriend'),
+                    ));
+            }
         }
     }
 
@@ -56,8 +77,8 @@ class BxPersonsMenuViewPerson extends BxTemplMenu {
             return false;
 
         // don't show current item, also this will solve problem when only one view note item is visible
-        if ('bx_persons_view' == $this->_sObject && $this->_isSelected($a))
-            return false;
+//        if ('bx_persons_view_actions' == $this->_sObject && $this->_isSelected($a))
+//            return false;
 
         $sFuncCheckAccess = false;
         switch ($a['name']) {
@@ -82,12 +103,15 @@ class BxPersonsMenuViewPerson extends BxTemplMenu {
             case 'profile-subscribe-remove':
                 $sFuncCheckAccess = 'isAllowedSubscribeRemove';
                 break;
+            case 'profile-actions-more':
+                $sFuncCheckAccess = 'isAllowedViewMoreMenu';
+                break;            
         }
 
         if (!$sFuncCheckAccess)
             return true;
 
-        return $sFuncCheckAccess && CHECK_ACTION_RESULT_ALLOWED === $this->_oModule->$sFuncCheckAccess($this->_aContentInfo) ? true : false;
+        return $sFuncCheckAccess && $this->_oModule && CHECK_ACTION_RESULT_ALLOWED === $this->_oModule->$sFuncCheckAccess($this->_aContentInfo) ? true : false;
     }
 
 }

+ 20 - 4
modules/boonex/persons/classes/BxPersonsModule.php

@@ -175,7 +175,7 @@ class BxPersonsModule extends BxDolModule implements iBxDolProfileService {
             return false;
 
         bx_import('BxTemplMenu');
-        $oMenu = BxTemplMenu::getObjectInstance('bx_persons_view');
+        $oMenu = BxTemplMenu::getObjectInstance('bx_persons_view_actions');
         return $oMenu ? $oMenu->getCode() : false;
     }
 
@@ -344,6 +344,17 @@ class BxPersonsModule extends BxDolModule implements iBxDolProfileService {
         return _t('_sys_txt_access_denied');
     }
 
+    /**
+     * @return CHECK_ACTION_RESULT_ALLOWED if access is granted or error message if access is forbidden. 
+     */
+    function isAllowedViewMoreMenu (&$aDataEntry, $isPerformAction = false) {
+        bx_import('BxTemplMenu');
+        $oMenu = BxTemplMenu::getObjectInstance('bx_persons_view_actions_more');
+        if (!$oMenu || !$oMenu->getCode())
+            return _t('_sys_txt_access_denied');
+        return CHECK_ACTION_RESULT_ALLOWED;
+    }
+
     /**
      * @return CHECK_ACTION_RESULT_ALLOWED if access is granted or error message if access is forbidden. 
      */
@@ -355,7 +366,9 @@ class BxPersonsModule extends BxDolModule implements iBxDolProfileService {
      * @return CHECK_ACTION_RESULT_ALLOWED if access is granted or error message if access is forbidden. 
      */
     function isAllowedFriendRemove (&$aDataEntry, $isPerformAction = false) {
-        return $this->_isAllowedConnect ($aDataEntry, $isPerformAction, 'sys_profiles_friends', true, true);
+        if (CHECK_ACTION_RESULT_ALLOWED === $this->_isAllowedConnect ($aDataEntry, $isPerformAction, 'sys_profiles_friends', false, true, true))
+            return CHECK_ACTION_RESULT_ALLOWED;
+        return $this->_isAllowedConnect ($aDataEntry, $isPerformAction, 'sys_profiles_friends', false, true, false);
     }
 
     /**
@@ -372,7 +385,7 @@ class BxPersonsModule extends BxDolModule implements iBxDolProfileService {
         return $this->_isAllowedConnect ($aDataEntry, $isPerformAction, 'sys_profiles_subscriptions', false, true);
     }
 
-    function _isAllowedConnect (&$aDataEntry, $isPerformAction, $sObjConnection, $isMutual, $isInvertResult) {
+    function _isAllowedConnect (&$aDataEntry, $isPerformAction, $sObjConnection, $isMutual, $isInvertResult, $isSwap = false) {
         if (!$this->_iProfileId)
             return _t('_sys_txt_access_denied');
 
@@ -383,7 +396,10 @@ class BxPersonsModule extends BxDolModule implements iBxDolProfileService {
 
         bx_import('BxDolConnection');
         $oConn = BxDolConnection::getObjectInstance($sObjConnection);
-        $isConnected = $oConn->isConnected($this->_iProfileId, $oProfile->id(), $isMutual);
+        if ($isSwap)
+            $isConnected = $oConn->isConnected($oProfile->id(), $this->_iProfileId, $isMutual);
+        else
+            $isConnected = $oConn->isConnected($this->_iProfileId, $oProfile->id(), $isMutual);
 
         if ($isInvertResult)
             $isConnected = !$isConnected;

+ 2 - 2
modules/boonex/persons/classes/BxPersonsPageProfile.php

@@ -68,7 +68,7 @@ class BxPersonsPageProfile extends BxTemplPage {
                 $aInformers[] = array ('name' => 'bx-persons-status-not-active', 'msg' => _t($this->_aMapStatus2LangKey[$sStatus]), 'type' => BX_INFORMER_ALERT);
             }
         }
-
+/*
         // display pending connetion requests
         if (isLogged()) {
             $aInformer = false;
@@ -81,7 +81,7 @@ class BxPersonsPageProfile extends BxTemplPage {
             if ($aInformer)
                 $aInformers[] = $aInformer;
         }
-
+*/
         // display message if it is possible to switch to this profile
         $oProfile = $this->_aContentInfo ? BxDolProfile::getInstanceByContentTypeAccount($this->_aContentInfo['id'], 'bx_persons') : false;
         if ($oProfile)

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

@@ -66,30 +66,36 @@
 	<string name="_bx_persons_page_block_title_profile_actions"><![CDATA[Actions]]></string>
 	<string name="_bx_persons_page_block_title_latest_persons"><![CDATA[Recent Persons]]></string>
 
-    <string name="_bx_persons_menu_set_title_view_person"><![CDATA[View Person]]></string>
+    <string name="_bx_persons_menu_set_title_view_person_actions"><![CDATA[Person Actions]]></string>
+    <string name="_bx_persons_menu_title_view_person_actions"><![CDATA[Person Actions]]></string>
+    <string name="_bx_persons_menu_set_title_view_person_actions_more"><![CDATA[Person More Actions]]></string>
+    <string name="_bx_persons_menu_title_view_person_actions_more"><![CDATA[Person More Actions]]></string>
     <string name="_bx_persons_menu_set_title_view_person_submenu"><![CDATA[View Person Submenu]]></string>
-    <string name="_bx_persons_menu_title_view_person"><![CDATA[View Person]]></string>
     <string name="_bx_persons_menu_title_view_person_submenu"><![CDATA[View Person Submenu]]></string>
     <string name="_bx_persons_menu_item_title_system_edit_person"><![CDATA[Edit Person]]></string>
     <string name="_bx_persons_menu_item_title_edit_person"><![CDATA[Edit Profile]]></string>
     <string name="_bx_persons_menu_item_title_system_delete_person"><![CDATA[Delete Person]]></string>
     <string name="_bx_persons_menu_item_title_delete_person"><![CDATA[Delete Profile]]></string>
-    <string name="_bx_persons_menu_item_title_system_view_person"><![CDATA[View Person]]></string>
-    <string name="_bx_persons_menu_item_title_view_person"><![CDATA[View Profile]]></string>
     <string name="_bx_persons_menu_item_title_system_persons_profile"><![CDATA[Person]]></string>
     <string name="_bx_persons_menu_item_title_persons_profile"><![CDATA[Person]]></string>
     <string name="_bx_persons_menu_item_title_system_create_person"><![CDATA[Create Person]]></string>
     <string name="_bx_persons_menu_item_title_create_person"><![CDATA[Create Person]]></string>
     <string name="_bx_persons_menu_item_title_system_view_person_info"><![CDATA[Info]]></string>
     <string name="_bx_persons_menu_item_title_view_person_info"><![CDATA[Info]]></string>
-    <string name="_bx_persons_menu_item_title_system_befriend"><![CDATA[Befriend]]></string>
-    <string name="_bx_persons_menu_item_title_befriend"><![CDATA[Befriend]]></string>
+    <string name="_bx_persons_menu_item_title_system_befriend"><![CDATA[Add friend]]></string>
+    <string name="_bx_persons_menu_item_title_befriend"><![CDATA[Add friend]]></string>
+    <string name="_bx_persons_menu_item_title_befriend_sent"><![CDATA[Friend request sent]]></string>
+    <string name="_bx_persons_menu_item_title_befriend_confirm"><![CDATA[Accept friend request]]></string>
     <string name="_bx_persons_menu_item_title_system_unfriend"><![CDATA[Unfriend]]></string>
     <string name="_bx_persons_menu_item_title_unfriend"><![CDATA[Unfriend]]></string>
+    <string name="_bx_persons_menu_item_title_unfriend_cancel_request"><![CDATA[Cancel friend request]]></string>
+    <string name="_bx_persons_menu_item_title_unfriend_reject_request"><![CDATA[Reject friend request]]></string>
     <string name="_bx_persons_menu_item_title_system_subscribe"><![CDATA[Subscribe]]></string>
     <string name="_bx_persons_menu_item_title_subscribe"><![CDATA[Subscribe]]></string>
     <string name="_bx_persons_menu_item_title_system_unsubscribe"><![CDATA[Unsubscribe]]></string>
     <string name="_bx_persons_menu_item_title_unsubscribe"><![CDATA[Unsubscribe]]></string>
+    <string name="_bx_persons_menu_item_title_system_more_actions"><![CDATA[More Actions]]></string>
+    <string name="_bx_persons_menu_item_title_more_actions"><![CDATA[]]></string>
 
 	<string name="_bx_persons_txt_error_profile_creation"><![CDATA[Profile creation failed]]></string>
 	<string name="_bx_persons_txt_error_profile_update"><![CDATA[Profile update failed]]></string>

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

@@ -31,7 +31,7 @@ DELETE FROM `sys_pages_blocks` WHERE `module` = 'bx_persons' OR `object` IN('bx_
 
 DELETE FROM `sys_objects_menu` WHERE `module` = 'bx_persons';
 DELETE FROM `sys_menu_sets` WHERE `module` = 'bx_persons';
-DELETE FROM `sys_menu_items` WHERE `module` = 'bx_persons' OR `set_name` IN('bx_persons_view', 'bx_persons_view_submenu');
+DELETE FROM `sys_menu_items` WHERE `module` = 'bx_persons' OR `set_name` IN('bx_persons_view_submenu', 'bx_persons_view_actions', 'bx_persons_view_actions_more');
 
 -- ACL
 

+ 22 - 10
modules/boonex/persons/install/sql/enable.sql

@@ -125,22 +125,34 @@ INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `tit
 
 
 --
--- Dumping data for 'bx_persons_view' menu
+-- Dumping data for 'bx_persons_view_actions' menu
 --
 INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
-('bx_persons_view', '_bx_persons_menu_title_view_person', 'bx_persons_view', 'bx_persons', 9, 0, 1, 'BxPersonsMenuViewPerson', 'modules/boonex/persons/classes/BxPersonsMenuViewPerson.php');
+('bx_persons_view_actions', '_bx_persons_menu_title_view_person_actions', 'bx_persons_view_actions', 'bx_persons', 9, 0, 1, 'BxPersonsMenuViewPerson', 'modules/boonex/persons/classes/BxPersonsMenuViewPerson.php');
 
 INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
-('bx_persons_view', 'bx_persons', '_bx_persons_menu_set_title_view_person', 0);
+('bx_persons_view_actions', 'bx_persons', '_bx_persons_menu_set_title_view_person_actions', 0);
 
 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_view', 'bx_persons', 'profile-friend-add', '_bx_persons_menu_item_title_system_befriend', '_bx_persons_menu_item_title_befriend', 'javascript:void(0)', 'bx_conn_action(\'sys_profiles_friends\', \'add\', \'{profile_id}\')', '', 'plus', '', 2147483647, 1, 0, 0),
-('bx_persons_view', 'bx_persons', 'profile-friend-remove', '_bx_persons_menu_item_title_system_unfriend', '_bx_persons_menu_item_title_unfriend', 'javascript:void(0)', 'bx_conn_action(\'sys_profiles_friends\', \'remove\', \'{profile_id}\', true)', '', 'plus-circle', '', 2147483647, 1, 0, 1),
-('bx_persons_view', 'bx_persons', 'profile-subscribe-add', '_bx_persons_menu_item_title_system_subscribe', '_bx_persons_menu_item_title_subscribe', 'javascript:void(0)', 'bx_conn_action(\'sys_profiles_subscriptions\', \'add\', \'{profile_id}\')', '', 'check', '', 2147483647, 1, 0, 2),
-('bx_persons_view', 'bx_persons', 'profile-subscribe-remove', '_bx_persons_menu_item_title_system_unsubscribe', '_bx_persons_menu_item_title_unsubscribe', 'javascript:void(0)', 'bx_conn_action(\'sys_profiles_subscriptions\', \'remove\', \'{profile_id}\')', '', 'check-circle', '', 2147483647, 1, 0, 3),
-('bx_persons_view', 'bx_persons', 'view-persons-profile', '_bx_persons_menu_item_title_system_view_person', '_bx_persons_menu_item_title_view_person', 'page.php?i=view-persons-profile&id={content_id}', '', '', 'user', '', 2147483647, 1, 0, 4),
-('bx_persons_view', 'bx_persons', 'edit-persons-profile', '_bx_persons_menu_item_title_system_edit_person', '_bx_persons_menu_item_title_edit_person', 'page.php?i=edit-persons-profile&id={content_id}', '', '', 'pencil', '', 2147483647, 1, 0, 5),
-('bx_persons_view', 'bx_persons', 'delete-persons-profile', '_bx_persons_menu_item_title_system_delete_person', '_bx_persons_menu_item_title_delete_person', 'page.php?i=delete-persons-profile&id={content_id}', '', '', 'remove', '', 2147483647, 1, 0, 6);
+('bx_persons_view_actions', 'bx_persons', 'profile-friend-add', '_bx_persons_menu_item_title_system_befriend', '{title_add_friend}', 'javascript:void(0)', 'bx_conn_action(this, \'sys_profiles_friends\', \'add\', \'{profile_id}\')', '', 'plus', '', 2147483647, 1, 0, 10),
+('bx_persons_view_actions', 'bx_persons', 'profile-subscribe-add', '_bx_persons_menu_item_title_system_subscribe', '_bx_persons_menu_item_title_subscribe', 'javascript:void(0)', 'bx_conn_action(this, \'sys_profiles_subscriptions\', \'add\', \'{profile_id}\')', '', 'check', '', 2147483647, 1, 0, 20),
+('bx_persons_view_actions', 'bx_persons', 'profile-actions-more', '_bx_persons_menu_item_title_system_more_actions', '_bx_persons_menu_item_title_more_actions', 'javascript:void(0)', 'bx_menu_popup(''bx_persons_view_actions_more'', this, {}, {profile_id:{profile_id}});', '', 'cog', '', 2147483647, 1, 0, 30);
+
+--
+-- Dumping data for 'bx_persons_view_actions_more' menu
+--
+INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_persons_view_actions_more', '_bx_persons_menu_title_view_person_actions_more', 'bx_persons_view_actions_more', 'bx_persons', 6, 0, 1, 'BxPersonsMenuViewPerson', 'modules/boonex/persons/classes/BxPersonsMenuViewPerson.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_persons_view_actions_more', 'bx_persons', '_bx_persons_menu_set_title_view_person_actions_more', 0);
+
+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_view_actions_more', 'bx_persons', 'profile-friend-remove', '_bx_persons_menu_item_title_system_unfriend', '{title_remove_friend}', 'javascript:void(0)', 'bx_conn_action(this, \'sys_profiles_friends\', \'remove\', \'{profile_id}\')', '', 'minus', '', 2147483647, 1, 0, 10),
+('bx_persons_view_actions_more', 'bx_persons', 'profile-subscribe-remove', '_bx_persons_menu_item_title_system_unsubscribe', '_bx_persons_menu_item_title_unsubscribe', 'javascript:void(0)', 'bx_conn_action(this, \'sys_profiles_subscriptions\', \'remove\', \'{profile_id}\')', '', 'check', '', 2147483647, 1, 0, 20),
+('bx_persons_view_actions_more', 'bx_persons', 'edit-persons-profile', '_bx_persons_menu_item_title_system_edit_person', '_bx_persons_menu_item_title_edit_person', 'page.php?i=edit-persons-profile&id={content_id}', '', '', 'pencil', '', 2147483647, 1, 0, 30),
+('bx_persons_view_actions_more', 'bx_persons', 'delete-persons-profile', '_bx_persons_menu_item_title_system_delete_person', '_bx_persons_menu_item_title_delete_person', 'page.php?i=delete-persons-profile&id={content_id}', '', '', 'remove', '', 2147483647, 1, 0, 40);
+
 
 --
 -- Dumping data for 'bx_persons_view_submenu' menu

+ 5 - 4
template/css/common.css

@@ -201,6 +201,10 @@ blockquote {
     margin-left:5px;
     vertical-align:middle;
 }
+.bx-btn .bx-loading-ajax-btn {
+    margin-top:8px;
+    vertical-align:top;
+}
 
 /* --------------- button */
 
@@ -249,15 +253,12 @@ blockquote {
 .bx-btn:first-child {
     margin-left:0;
 }
-.bx-btn img,
-.bx-btn i.sys-icon {
-    margin-right:3px;
-}
 .bx-btn img {
     width:16px;
     height:16px;
 }
 .bx-btn u {
+    margin-left:2px;
     text-decoration:none;
 }
 .bx-btn .sys-icon {

+ 21 - 0
template/scripts/BxBasePage.php

@@ -33,6 +33,18 @@ class BxBasePage extends BxDolPage {
      */
     public function getCode () {
 
+        if (bx_get('dynamic') && ($iBlockId = (int)bx_get('pageBlock'))) {
+
+            if (!$this->_isVisiblePage($this->_aObject)) {
+                header('HTTP/1.0 403 Forbidden');
+                exit;
+            }
+            
+            header( 'Content-type:text/html;charset=utf-8' );
+            echo $this->_getBlockOnlyCode($iBlockId);
+            exit;
+        }
+
         if (!$this->_isVisiblePage($this->_aObject))
             return $this->_getPageAccessDeniedMsg ();
 
@@ -90,6 +102,15 @@ class BxBasePage extends BxDolPage {
         return $this->_oTemplate->parseHtmlByName($this->_aObject['template'], $aVars);
     }
 
+    /**
+     * Get one block code only.
+     * @return string
+     */
+    protected function _getBlockOnlyCode ($iBlockId) {
+        $aBlock = $this->_oQuery->getPageBlock((int)$iBlockId);
+        return $this->_getBlockCode($aBlock);
+    }
+
     /**
      * Get block code.
      * @return string