roman.lesnikov@gmail.com před 2 roky
rodič
revize
2d79728c96

+ 25 - 0
inc/classes/BxDolCover.php

@@ -136,6 +136,19 @@ class BxDolCover extends BxDolFactory implements iBxDolSingleton
         if (false !== $sTemplateName)
             $this->_sTemplateName = $sTemplateName;
 
+         /**
+         * @hooks
+         * @hookdef hook-system-set_cover 'system', 'set_cover' - hook in set cover 
+         * - $unit_name - equals `account`
+         * - $action - equals `set_cover` 
+         * - $object_id - not used
+         * - $sender_id - not used 
+         * - $extra_params - array of additional params with the following array keys:
+         *      - `options` - [array] by ref, cover options, default template supports the following: title, can be overridden in hook processing
+         *      - `override_result` - [string] by ref, template name, can be overridden in hook processing
+         *      - `cover` - [object] object cover
+         * @hook @ref hook-system-set_cover
+         */
         bx_alert('system', 'set_cover', 0, false, array('options' => &$this->_aOptions, 'template_name' => &$this->_sTemplateName, 'cover' => $this));
     }
 
@@ -158,6 +171,18 @@ class BxDolCover extends BxDolFactory implements iBxDolSingleton
         if(!$this->_sCoverImageUrl)
             return false;
 
+        /**
+         * @hooks
+         * @hookdef hook-system-set_cover 'system', 'set_cover_image' - hook on cover image
+         * - $unit_name - equals `system`
+         * - $action - equals `set_cover_image` 
+         * - $object_id - not used
+         * - $sender_id - not used 
+         * - $extra_params - array of additional params with the following array keys:
+         *      - `cover_image` - [string] by ref, cover image url, or array with file id and storage or transcoder object, can be overridden in hook processing
+         *      - `cover` - [object] object cover
+         * @hook @ref hook-system-set_cover_image
+         */
         bx_alert('system', 'set_cover_image', 0, false, array('cover_image' => &$this->_sCoverImageUrl, 'cover' => $this));
 
         return true;

+ 15 - 0
inc/classes/BxDolEmailTemplates.php

@@ -129,6 +129,21 @@ class BxDolEmailTemplates extends BxDolFactory implements iBxDolSingleton
     {
         $aTemplate = $this->getTemplate($sTemplateName, $iAccountId);
         
+        /**
+         * @hooks
+         * @hookdef hook-system-parse_email_template 'system', 'parse_email_template' - hook on template with neccessary markers replaced
+         * - $unit_name - equals `system`
+         * - $action - equals `parse_email_template` 
+         * - $object_id - not used
+         * - $sender_id - not used 
+         * - $extra_params - array of additional params with the following array keys:
+         *      - `template_name` - [string] by ref, name of necessary template, can be overridden in hook processing
+         *      - `template_keys` - [array] by ref, key ane value pairs to replace in subject and body, can be overridden in hook processing
+         *      - `account_id` - [int] by ref, account ID of registered member, can be overridden in hook processing
+         *      - `profile_id` - [int] by ref, profile ID of registered member, can be overridden in hook processing
+         *      - `template` - [array] by ref, template, can be overridden in hook processing
+         * @hook @ref hook-system-parse_email_template
+         */
         bx_alert('system', 'parse_email_template', 0, 0, array('template_name' => &$sTemplateName, 'template_keys' => &$aTemplateKeys, 'account_id' => &$iAccountId, 'profile_id' => &$iProfileId, 'template' => &$aTemplate));
         
         if (!$aTemplate)

+ 26 - 0
inc/classes/BxDolFeature.php

@@ -176,6 +176,32 @@ class BxDolFeature extends BxDolObject
         );
 
         bx_alert($this->_sSystem, ($bPerformUndo ? 'un' : '') . 'feature', $iObjectId, $iAuthorId, array('object_author_id' => $iObjectAuthorId));
+        /**
+         * @hooks
+         * @hookdef hook-feature-undo 'feature', 'undo' - hook on cancel feature 
+         * - $unit_name - equals `feature`
+         * - $action - equals `undo` 
+         * - $object_id - report id 
+         * - $sender_id - profile_id for feature's author
+         * - $extra_params - array of additional params with the following array keys:
+         *      - `object_system` - [string] system name, ex: bx_posts
+         *      - `object_id` - [int] feature object id 
+         *      - `object_author_id` - [int] author's profile_id for feature object_id 
+         * @hook @ref hook-feature-undo
+         */
+        /**
+         * @hooks
+         * @hookdef hook-feature-do 'feature', 'do' - hook on feature 
+         * - $unit_name - equals `feature`
+         * - $action - equals `do` 
+         * - $object_id - report id 
+         * - $sender_id - profile_id for feature's author
+         * - $extra_params - array of additional params with the following array keys:
+         *      - `object_system` - [string] system name, ex: bx_posts
+         *      - `object_id` - [int] feature object id 
+         *      - `object_author_id` - [int] author's profile_id for feature object_id 
+         * @hook @ref hook-feature-do
+         */
         bx_alert('feature', ($bPerformUndo ? 'un' : '') . 'do', 0, $iAuthorId, array('object_system' => $this->_sSystem, 'object_id' => $iObjectId, 'object_author_id' => $iObjectAuthorId));
 
         return array(

+ 11 - 1
inc/classes/BxDolInformer.php

@@ -126,7 +126,17 @@ class BxDolInformer extends BxDolFactory implements iBxDolSingleton
                 $oProfile->addInformerPermanentMessages($this);
         }
 
-        // add permament messages from modules
+        /**
+         * @hooks
+         * @hookdef hook-system-informer_permament_messages 'system', 'informer_permament_messages' - hook on informer
+         * - $unit_name - equals `system`
+         * - $action - equals `informer_permament_messages` 
+         * - $object_id - label id 
+         * - $sender_id - not used 
+         * - $extra_params - array of additional params with the following array keys:
+         *      - `informer` - [object] object with informer
+         * @hook @ref hook-system-informer_permament_messages
+         */
         bx_alert('system', 'informer_permament_messages', 0, false, array('informer' => $this));
     }
 

+ 33 - 0
inc/classes/BxDolLabel.php

@@ -139,6 +139,17 @@ class BxDolLabel extends BxDolFactory implements iBxDolSingleton
         if(empty($aLabel) || !is_array($aLabel))
             return;
 
+        /**
+         * @hooks
+         * @hookdef hook-label-edited 'label', 'added' - hook on new label added
+         * - $unit_name - equals `label`
+         * - $action - equals `added` 
+         * - $object_id - label id 
+         * - $sender_id - not used 
+         * - $extra_params - array of additional params with the following array keys:
+         *      - `label` - [array] array with label info
+         * @hook @ref hook-label-added
+         */
         bx_alert('label', 'added', $iId, false, array('label' => $aLabel));
     }
 
@@ -148,6 +159,17 @@ class BxDolLabel extends BxDolFactory implements iBxDolSingleton
         if(empty($aLabel) || !is_array($aLabel))
             return;
 
+        /**
+         * @hooks
+         * @hookdef hook-label-edited 'label', 'edited' - hook on new label edited
+         * - $unit_name - equals `label`
+         * - $action - equals `edited` 
+         * - $object_id - label id 
+         * - $sender_id - not used 
+         * - $extra_params - array of additional params with the following array keys:
+         *      - `label` - [array] array with label info
+         * @hook @ref hook-label-edited
+         */
         bx_alert('label', 'edited', $iId, false, array('label' => $aLabel));
     }
 
@@ -157,6 +179,17 @@ class BxDolLabel extends BxDolFactory implements iBxDolSingleton
         if(empty($aLabel) || !is_array($aLabel))
             return;
 
+         /**
+         * @hooks
+         * @hookdef hook-label-deleted 'label', 'deleted' - hook on new label deleted
+         * - $unit_name - equals `label`
+         * - $action - equals `deleted` 
+         * - $object_id - label id 
+         * - $sender_id - not used 
+         * - $extra_params - array of additional params with the following array keys:
+         *      - `label` - [array] array with label info
+         * @hook @ref hook-label-deleted
+         */
         bx_alert('label', 'deleted', $iId, false, array('label' => $aLabel));
     }
 

+ 29 - 0
inc/classes/BxDolMetatags.php

@@ -385,6 +385,20 @@ class BxDolMetatags extends BxDolFactory implements iBxDolFactoryObject
             $sSource = $this->_sObject . '_' . $iId;
 
             bx_alert($this->_aObject['module'], 'keyword_added', $iId, bx_get_logged_profile_id(), array('meta' => $s, 'content_id' => $iId, 'source' => $sSource));
+            /**
+             * @hooks
+             * @hookdef hook-meta_keyword-added 'meta_keyword', 'added' - hook on new keyword added
+             * - $unit_name - equals `meta_keyword`
+             * - $action - equals `added` 
+             * - $object_id - meta keyword id
+             * - $sender_id - profile_id for current user 
+             * - $extra_params - array of additional params with the following array keys:
+             *      - `meta` - [string] keyword
+             *      - `content_id` - [string] content id
+             *      - `object` - [string] object name
+             *      - `source` - [string] source
+             * @hook @ref hook-meta_keyword-added
+             */
             bx_alert('meta_keyword', 'added', $iId, bx_get_logged_profile_id(), array('meta' => $s, 'content_id' => $iId, 'object' => $this->_sObject, 'source' => $sSource));
         }
 
@@ -491,6 +505,21 @@ class BxDolMetatags extends BxDolFactory implements iBxDolFactoryObject
         }
         
         $sUrl = BX_DOL_URL_ROOT . 'searchKeyword.php?type=keyword&keyword=' . rawurlencode($sKeyword) . $sSectionPart;
+        /**
+         * @hooks
+         * @hookdef hook-meta_keyword-url 'meta_keyword', 'url' - hook on get URL for hashtags
+         * - $unit_name - equals `meta_keyword`
+         * - $action - equals `url` 
+         * - $object_id - not used
+         * - $sender_id - not used 
+         * - $extra_params - array of additional params with the following array keys:
+         *      - `url` - [string] by ref, url for hashtag
+         *      - `keyword` - [string] hashtag
+         *      - `id` - [int] hashtag id
+         *      - `sObject` - [string] object name
+         *      - `section` - [string] section name
+         * @hook @ref hook-meta_keyword-url
+         */
         bx_alert('meta_keyword', 'url', 0, false, array(
            'url' => &$sUrl,
            'keyword' => $sKeyword,

+ 13 - 1
inc/classes/BxDolMetatagsQuery.php

@@ -67,8 +67,20 @@ class BxDolMetatagsQuery extends BxDolDb
     public function keywordsDelete($mixedContentId)
     {
         $mixedResult = $this->metaDelete($this->_aObject['table_keywords'], $mixedContentId);
-        if ($mixedResult != false)
+        if ($mixedResult != false){
+             /**
+             * @hooks
+             * @hookdef hook-meta_keyword-deleted 'meta_keyword', 'deleted' - hook on delete meta keyword
+             * - $unit_name - equals `meta_keyword`
+             * - $action - equals `deleted` 
+             * - $object_id - content_id
+             * - $sender_id - profile_id fror logged user
+             * - $extra_params - array of additional params with the following array keys:
+             *      - `object` - [string] object name
+             * @hook @ref hook-meta_keyword-deleted
+             */
             bx_alert('meta_keyword', 'deleted', $mixedContentId, bx_get_logged_profile_id(), array('object' => $this->_aObject['object']));
+        }
         return $mixedResult;
     }
 

+ 1 - 0
inc/classes/BxDolPermalinks.php

@@ -205,6 +205,7 @@ class BxDolPermalinks extends BxDolDb implements iBxDolSingleton
     function unpermalink($sLink, $isStripBaseUrl = true)
     {
         $sRet = null;
+        
         bx_alert('system', 'unpermalink', 0, 0, array('link' => $sLink, 'strip_base_url' => $isStripBaseUrl, 'return_data' => &$sRet));
         if (null !== $sRet)
             return $sRet;

+ 31 - 1
inc/classes/BxDolPrivacy.php

@@ -521,7 +521,22 @@ class BxDolPrivacy extends BxDolFactory implements iBxDolFactoryObject
                     'table' => $this->_aObject['table'],
                 ),
             ),
-        );      
+        );   
+         /**
+         * @hooks
+         * @hookdef hook-system-privacy_condition 'system', 'privacy_condition' - hook on get necessary condition array to use privacy in search classes
+         * - $unit_name - equals `profile`
+         * - $action - equals `privacy_condition` 
+         * - $object_id - not used
+         * - $sender_id - not used 
+         * - $extra_params - array of additional params with the following array keys:
+         *      - `group_id` - [int] group ID or array of group IDs
+         *      - `field` - [string] field name
+         *      - `object` - [array] array with object privacy 
+         *      - `privacy_object` - [array] object privacy 
+         *      - `result` - [bool] by ref, on success return true otherwise false, can be overridden in hook processing
+         * @hook @ref hook-system-privacy_condition
+         */
         bx_alert('system', 'privacy_condition', 0, false, array(
             'group_id' => $mixedGroupId,
             'field' => $this->convertActionToField($this->_aObject['action']),
@@ -598,6 +613,21 @@ class BxDolPrivacy extends BxDolFactory implements iBxDolFactoryObject
     {
         $aObject = $this->getObjectInfo($this->convertActionToField($this->_aObject['action']), $iObjectId);
         $bRv = $this->_check($iObjectId, $iViewerId, $aObject);
+        /**
+         * @hooks
+         * @hookdef hook-system-check_privacy 'system', 'check_privacy' - check privacy for object
+         * - $unit_name - equals `profile`
+         * - $action - equals `check_privacy` 
+         * - $object_id - not used
+         * - $sender_id - not used 
+         * - $extra_params - array of additional params with the following array keys:
+         *      - `object_id` - [int] object id
+         *      - `viewer_id` - [int] profile_id for viewer
+         *      - `object` - [array] object privacy 
+         *      - `object_privacy` - [array] arry with object privacy 
+         *      - `result` - [bool] by ref, on success return true otherwise false, can be overridden in hook processing
+         * @hook @ref hook-system-check_privacy
+         */
         bx_alert('system', 'check_privacy', 0, 0, array(
            'object_id' => $iObjectId,
            'viewer_id' => $iViewerId,

+ 79 - 3
inc/classes/BxDolProfile.php

@@ -310,6 +310,18 @@ class BxDolProfile extends BxDolFactory implements iBxDolProfile
     {
         $aInfo = $this->getInfo($iProfileId);
         $sDisplayName = BxDolService::call($aInfo['type'], 'profile_name', array($aInfo['content_id']));
+        /**
+         * @hooks
+         * @hookdef hook-profile-profile_name 'profile', 'profile_name' - hook on before profile deletion
+         * - $unit_name - equals `profile`
+         * - $action - equals `profile_name` 
+         * - $object_id - profile_id 
+         * - $sender_id - not used 
+         * - $extra_params - array of additional params with the following array keys:
+         *      - `info` - [array] profile info
+         *      - `display_name` - [bool] by ref, display profile name, can be overridden in hook processing
+         * @hook @ref hook-profile-profile_name
+         */
         bx_alert('profile', 'profile_name', $iProfileId, 0, array('info' => $aInfo, 'display_name' => &$sDisplayName));
         return $sDisplayName;
     }
@@ -505,8 +517,20 @@ class BxDolProfile extends BxDolFactory implements iBxDolProfile
         if (!$bForceDelete && $ID == $aAccountInfo['profile_id'])
             $oAccount->updateProfileContextAuto($ID);
 
-        // create system event before deletion
         $isStopDeletion = false;
+        /**
+         * @hooks
+         * @hookdef hook-profile-before_delete 'profile', 'before_delete' - hook on before profile deletion
+         * - $unit_name - equals `profile`
+         * - $action - equals `before_delete` 
+         * - $object_id - profile_id 
+         * - $sender_id - not used 
+         * - $extra_params - array of additional params with the following array keys:
+         *      - `delete_with_content` - [bool] also delete content for profile or not
+         *      - `stop_deletion` - [bool] by ref, if true then stop profile deletion, can be overridden in hook processing
+         *      - `type` - [string] module name
+         * @hook @ref hook-profile-before_delete
+         */
         bx_alert('profile', 'before_delete', $ID, 0, array('delete_with_content' => $bDeleteWithContent, 'stop_deletion' => &$isStopDeletion, 'type' => $aProfileInfo['type']));
         if ($isStopDeletion)
             return false;
@@ -541,7 +565,18 @@ class BxDolProfile extends BxDolFactory implements iBxDolProfile
         if (!$this->_oQuery->delete($ID))
             return false;
 
-        // create system event
+        /**
+         * @hooks
+         * @hookdef hook-profile-delete 'profile', 'delete' - hook on profile deleted
+         * - $unit_name - equals `profile`
+         * - $action - equals `delete` 
+         * - $object_id - profile_id 
+         * - $sender_id - not used 
+         * - $extra_params - array of additional params with the following array keys:
+         *      - `delete_with_content` - [bool] also delete content for profile or not
+         *      - `type` - [string] module name
+         * @hook @ref hook-profile-delete
+         */
         bx_alert('profile', 'delete', $ID, 0, array('delete_with_content' => $bDeleteWithContent, 'type' => $aProfileInfo['type']));
 
         // unset class instance to prevent creating the instance again
@@ -565,6 +600,22 @@ class BxDolProfile extends BxDolFactory implements iBxDolProfile
         $oQuery = BxDolProfileQuery::getInstance();
         if (!($iProfileId = $oQuery->insertProfile ($iAccountId, $iContentId, $sStatus, $sType)))
             return false;
+         /**
+         * @hooks
+         * @hookdef hook-profile-add 'profile', 'add' - hook on profile added
+         * - $unit_name - equals `profile`
+         * - $action - equals `add` 
+         * - $object_id - profile_id 
+         * - $sender_id - not used 
+         * - $extra_params - array of additional params with the following array keys:
+         *      - `module` - [string] action id
+         *      - `content` - [int] content_id in module
+         *      - `account` - [int] account_id
+         *      - `status` - [string] status 
+         *      - `action` - [int] action id
+         *      - `profile_id` - [int] by ref, iprofile_id, can be overridden in hook processing
+         * @hook @ref hook-profile-add
+         */
         bx_alert('profile', 'add', $iProfileId, 0, array('module' => $sType, 'content' => $iContentId, 'account' => $iAccountId, 'status' => $sStatus, 'action' => $iAction, 'profile_id' => &$iProfileId));
         return $iProfileId;
     }
@@ -650,7 +701,19 @@ class BxDolProfile extends BxDolFactory implements iBxDolProfile
 
         $this->_aProfile = array();
 
-        // alert about status changing
+        /**
+         * @hooks
+         * @hookdef hook-profile-approve 'profile', 'approve' - hook on switch profile
+         * - $unit_name - equals `profile`
+         * - $action - equals `approve` 
+         * - $object_id - profile_id for current user
+         * - $sender_id - not used 
+         * - $extra_params - array of additional params with the following array keys:
+         *      - `action` - [int] action id
+         *      - `status` - [string] by ref, status, can be overridden in hook processing
+         *      - `send_email_notification` - [bool] by ref, if need to send notification about changed status = true, otherwise false, can be overridden in hook processing
+         * @hook @ref hook-profile-approve
+         */
         bx_alert('profile', $sAlertActionName, $iProfileId, false, array('action' => $iAction, 'status' => &$sStatus, 'send_email_notification' => &$bSendEmailNotification));
         
         $this->doAudit('_sys_audit_action_set_status_' . $sStatus);
@@ -689,6 +752,19 @@ class BxDolProfile extends BxDolFactory implements iBxDolProfile
         $iSwitchToAccountId = $this->getAccountId();
         $iSwitchToProfileId = $this->id();
         $bCanSwitch = ($iSwitchToAccountId == $iViewerAccountId || $bAllowSwitchToAnyProfile);
+        /**
+         * @hooks
+         * @hookdef hook-account-check_switch_context 'account', 'check_switch_context' - hook on switch profile
+         * - $unit_name - equals `account`
+         * - $action - equals `check_switch_context` 
+         * - $object_id - account id 
+         * - $sender_id - not used 
+         * - $extra_params - array of additional params with the following array keys:
+         *      - `switch_to_profile` - [int] profile_id for switched profile
+         *      - `viewer_account` - [int] profile_id for viewer profile
+         *      - `override_result` - [bool] by ref, if allow to switch to profile = true, otherwise false, can be overridden in hook processing
+         * @hook @ref hook-account-check_switch_context
+         */
         bx_alert('account', 'check_switch_context', $iSwitchToAccountId, $iViewerProfileId, array('switch_to_profile' => $iSwitchToProfileId, 'viewer_account' => $iViewerAccountId, 'override_result' => &$bCanSwitch));
 
         if(!$bCanSwitch ||  $iViewerProfileId == $iSwitchToProfileId)

+ 11 - 0
inc/classes/BxDolPush.php

@@ -66,6 +66,17 @@ class BxDolPush extends BxDolFactory implements iBxDolSingleton
             'email_hash' => $sEmail ? hash_hmac('sha256', $sEmail, getParam('sys_push_app_id')) : '',
         );
 
+         /**
+         * @hooks
+         * @hookdef hook-system-is_confirmed 'system', 'push_tags' - hook on get tags to send to PUSH server
+         * - $unit_name - equals `system`
+         * - $action - equals `push_tags` 
+         * - $object_id - profile_id from current user
+         * - $sender_id - profile_id from current user
+         * - $extra_params - array of additional params with the following array keys:
+         *      - `tags` - [array] by ref, array of tags, can be overridden in hook processing
+         * @hook @ref hook-system-push_tags
+         */
         bx_alert('system', 'push_tags', $iProfileId, $iProfileId, array('tags' => &$a));
 
         return $a;

+ 1 - 0
inc/classes/BxDolRelation.php

@@ -265,6 +265,7 @@ class BxDolRelation extends BxDolConnection
     {
         $aRelations = BxDolFormQuery::getDataItems($this->_sPreList, false, BX_DATA_VALUES_ALL);
 
+        
         bx_alert($this->_sObject, 'get_relations', 0, bx_get_logged_profile_id(), array(
             'initiator' => (int)$iInitiator,
             'content' => (int)$iContent,

+ 39 - 0
inc/classes/BxDolSearch.php

@@ -741,6 +741,18 @@ class BxDolSearchResult implements iBxDolReplaceable
      */
     function getSearchData ()
     {
+        /**
+         * @hooks
+         * @hookdef hook-simple_search-before_get_data 'simple_search', 'before_get_data' - hook on before after get data 
+         * - $unit_name - equals `simple_search`
+         * - $action - equals `before_get_data` 
+         * - $object_id - not used 
+         * - $sender_id - not used 
+         * - $extra_params - array of additional params with the following array keys:
+         *      - `object` - [array] by ref, array of parameters, can be overridden in hook processing
+         *      - `mode` - [string] search mode
+         * @hook @ref hook-simple_search-before_get_data
+         */
         bx_alert('simple_search', 'before_get_data', 0, false, [
             'object' => &$this->aCurrent, 
             'mode' => $this->_sMode
@@ -758,6 +770,19 @@ class BxDolSearchResult implements iBxDolReplaceable
             $aData = sort($aIds) == sort($this->_aParams['validate']) ? 'valid' : 'invalid';
         }
 
+        /**
+         * @hooks
+         * @hookdef hook-simple_search-get_data 'simple_search', 'get_data' - hook on after get data 
+         * - $unit_name - equals `simple_search`
+         * - $action - equals `get_data` 
+         * - $object_id - not used 
+         * - $sender_id - not used 
+         * - $extra_params - array of additional params with the following array keys:
+         *      - `object` - [array] by ref, array of parameters, can be overridden in hook processing
+         *      - `mode` - [string] search mode
+         *      - `search_object` - [string] search object name
+         * @hook @ref hook-simple_search-get_data
+         */
         bx_alert('simple_search', 'get_data', 0, false, [
             'object' => &$this->aCurrent, 
             'mode' => $this->_sMode, 
@@ -786,6 +811,20 @@ class BxDolSearchResult implements iBxDolReplaceable
         $this->setConditionParams();
         $aQuery = $this->getSearchDataByParams($aParams);
 
+        /**
+         * @hooks
+         * @hookdef hook-simple_search-get_query 'simple_search', 'get_query' - hook on get sql queries
+         * - $unit_name - equals `simple_search`
+         * - $action - equals `get_query` 
+         * - $object_id - not used 
+         * - $sender_id - not used 
+         * - $extra_params - array of additional params with the following array keys:
+         *      - `object` - [array] by ref, array of parameters, can be overridden in hook processing
+         *      - `mode` - [string] search mode
+         *      - `search_object` - [string] search object name
+         *      - `search_query` - [array] by ref, array of sql, can be overridden in hook processing
+         * @hook @ref hook-simple_search-get_query
+         */
         bx_alert('simple_search', 'get_query', 0, false, [
             'object' => &$this->aCurrent, 
             'mode' => $this->_sMode, 

+ 12 - 0
inc/classes/BxDolSearchExtended.php

@@ -143,6 +143,18 @@ class BxDolSearchExtended extends BxDolFactory implements iBxDolFactoryObject
             }
         }
 
+        /**
+         * @hooks
+         * @hookdef hook-search-get_mention 'search', 'get_mention' - hook on get mention list
+         * - $unit_name - equals `search`
+         * - $action - equals `get_mention` 
+         * - $object_id - not used 
+         * - $sender_id - not used 
+         * - $extra_params - array of additional params with the following array keys:
+         *      - `params` - [array] array of parameters
+         *      - `override_result` - [array] by ref, array of colors, can be overridden in hook processing
+         * @hook @ref hook-search-get_mention
+         */
         bx_alert('search', 'get_mention', 0, 0, array('params' => $a[1], 'override_result' => &$aResult));
         
         header('Content-Type:text/javascript; charset=utf-8');

+ 62 - 0
inc/classes/BxDolTemplate.php

@@ -548,6 +548,17 @@ class BxDolTemplate extends BxDolFactory implements iBxDolSingleton
     {
         $aResult = self::$_aColors;
 
+        /**
+         * @hooks
+         * @hookdef hook-system-get_color_palette 'system', 'get_color_palette' - hook on get color palette
+         * - $unit_name - equals `system`
+         * - $action - equals `get_color_palette` 
+         * - $object_id - not used 
+         * - $sender_id - not used 
+         * - $extra_params - array of additional params with the following array keys:
+         *      - `override_result` - [array] by ref, array of colors, can be overridden in hook processing
+         * @hook @ref hook-system-get_color_palette
+         */
         bx_alert('system', 'get_color_palette', 0, false, array(
             'override_result' => &$aResult
         ));
@@ -692,6 +703,18 @@ class BxDolTemplate extends BxDolFactory implements iBxDolSingleton
         if(!self::$_aImages)
             self::$_aImages = [];
 
+        /**
+         * @hooks
+         * @hookdef hook-system-get_layout_images 'system', 'get_layout_images' - hook on get layout images
+         * - $unit_name - equals `system`
+         * - $action - equals `get_layout_images` 
+         * - $object_id - not used 
+         * - $sender_id - not used 
+         * - $extra_params - array of additional params with the following array keys:
+         *      - `code` - [string] page code
+         *      - `override_result` - [array] by ref, array of images, can be overridden in hook processing
+         * @hook @ref hook-system-get_layout_images
+         */
         bx_alert('system', 'get_layout_images', 0, false, [
             'code' => $this->_sCode,
             'override_result' => &self::$_aImages
@@ -2835,6 +2858,22 @@ class BxDolTemplate extends BxDolFactory implements iBxDolSingleton
             $sArrayKey = $sType . ($bSystem ? '_system' : '_compiled');
             switch($sAction) {
                 case 'add':
+                    /**
+                     * @hooks
+                     * @hookdef hook-system-add_files 'system', 'add_files' - hook on add file to page 
+                     * - $unit_name - equals `system`
+                     * - $action - equals `add_files` 
+                     * - $object_id - not used 
+                     * - $sender_id - not used 
+                     * - $extra_params - array of additional params with the following array keys:
+                     *      - `file` - [string] file name
+                     *      - `type` - [string] file type
+                     *      - `dynamic` - [bool] true if added as dynamic
+                     *      - `system` - [bool] true if system file
+                     *      - `url` - [string] by ref, file url, can be overridden in hook processing
+                     *      - `path` - [string] by ref, file path, can be overridden in hook processing
+                     * @hook @ref hook-system-add_files
+                     */
                     bx_alert('system', 'add_files', 0, 0, [
                         'file' => $sFile,
                         'type' => $sType,
@@ -3637,6 +3676,18 @@ class BxDolTemplate extends BxDolFactory implements iBxDolSingleton
         if (empty($oTemplate))
            $oTemplate = $this;
 
+        /**
+         * @hooks
+         * @hookdef hook-system-design_before_output 'system', 'design_before_output' - hook on before page's html generated
+         * - $unit_name - equals `system`
+         * - $action - equals `design_before_output` 
+         * - $object_id - not used 
+         * - $sender_id - not used 
+         * - $extra_params - array of additional params with the following array keys:
+         *      - `page` - [array] by ref, page object paramenters, can be overridden in hook processing
+         *      - `page_content` - [array] by ref, page content values, can be overridden in hook processing
+         * @hook @ref hook-system-design_before_output
+         */
         bx_alert('system', 'design_before_output', 0, 0, ['page' => &$this->aPage, 'page_content' => &$this->aPageContent]);
 
         header( 'Content-type: text/html; charset=utf-8' );
@@ -3646,6 +3697,17 @@ class BxDolTemplate extends BxDolFactory implements iBxDolSingleton
 
         $sResult = $oTemplate->parsePageByName('page_' . $oTemplate->getPageNameIndex() . '.html', $oTemplate->getPageContent());
         
+        /**
+         * @hooks
+         * @hookdef hook-system-design_after_output 'system', 'design_after_output' - hook on after page's html generated
+         * - $unit_name - equals `system`
+         * - $action - equals `design_after_output` 
+         * - $object_id - not used 
+         * - $sender_id - not used 
+         * - $extra_params - array of additional params with the following array keys:
+         *      - `override_result` - [string] by ref, html content for current page, can be overridden in hook processing
+         * @hook @ref hook-system-design_after_output
+         */
         bx_alert('system', 'design_after_output', 0, false, ['override_result' => &$sResult]);
         
         echo $sResult;

+ 27 - 0
inc/classes/BxDolTranscoder.php

@@ -490,6 +490,21 @@ class BxDolTranscoder extends BxDolFactory implements iBxDolFactoryObject
                 }
             }
 
+            /**
+             * @hooks
+             * @hookdef hook-system-transcode 'system', 'transcode' - hook on cancel vote 
+             * - $unit_name - equals `system`
+             * - $action - equals `transcode` 
+             * - $object_id - file handler
+             * - $sender_id - profile_id for vote's author
+             * - $extra_params - array of additional params with the following array keys:
+             *      - `transcoder_object` - [array] transcoder object properties
+             *      - `object` - [object] transcoder object
+             *      - `db` - [object] database object
+             *      - `file_path` - [string] file path
+             *      - `ret` - [bool] return 
+             * @hook @ref hook-system-transcode
+             */
             bx_alert('system', 'transcode', $mixedHandler, false, array(
                 'transcoder_object' => $this->_aObject['object'],
                 'object' => $this,
@@ -523,6 +538,18 @@ class BxDolTranscoder extends BxDolFactory implements iBxDolFactoryObject
 
         } while (false);
 
+        /**
+         * @hooks
+         * @hookdef hook-system-transcoded 'system', 'transcoded' - hook on cancel vote 
+         * - $unit_name - equals `system`
+         * - $action - equals `transcoded` 
+         * - $object_id - file handler
+         * - $sender_id - profile_id for vote's author
+         * - $extra_params - array of additional params with the following array keys:
+         *      - `object` - [object] transcoder object
+         *      - `ret` - [bool] reported object id 
+         * @hook @ref hook-system-transcoded
+         */
         bx_alert($this->_aObject['object'], 'transcoded', $mixedHandler, false, array(
             'object' => $this,
             'ret' => $bRet,

+ 27 - 0
inc/classes/BxDolVote.php

@@ -255,7 +255,34 @@ class BxDolVote extends BxDolObject
 
         $this->_trigger();
 
+        /**
+         * @hooks
+         * @hookdef hook-vote-undo 'vote', 'undo' - hook on cancel vote 
+         * - $unit_name - equals `vote`
+         * - $action - equals `undo` 
+         * - $object_id - vote id 
+         * - $sender_id - profile_id for vote's author
+         * - $extra_params - array of additional params with the following array keys:
+         *      - `object_system` - [string] system name, ex: bx_posts
+         *      - `object_id` - [int] reported object id 
+         *      - `object_author_id` - [int] author's profile_id for reported object_id 
+         * @hook @ref hook-vote-undo
+         */
         bx_alert($this->_sSystem, ($bPerformUndo ? 'un' : '') . 'doVote', $iObjectId, $iAuthorId, array_merge(['vote_id' => $iId, 'vote_author_id' => $iAuthorId, 'object_author_id' => $iObjectAuthorId], $aVoteData));
+        /**
+         * @hooks
+         * @hookdef hook-vote-do 'vote', 'do' - hook on new vote 
+         * - $unit_name - equals `vote`
+         * - $action - equals `do` 
+         * - $object_id - vote id 
+         * - $sender_id - profile_id for vote's author
+         * - $extra_params - array of additional params with the following array keys:
+         *      - `object_system` - [string] system name, ex: bx_posts
+         *      - `object_id` - [int] reported object id 
+         *      - `object_author_id` - [int] author's profile_id for reported object_id 
+         * @hook @ref hook-vote-do
+         */
+        
         bx_alert('vote', ($bPerformUndo ? 'un' : '') . 'do', $iId, $iAuthorId, array_merge(['object_system' => $this->_sSystem, 'object_id' => $iObjectId, 'object_author_id' => $iObjectAuthorId], $aVoteData));
 
         $aResult = $this->_returnVoteData($iObjectId, $iAuthorId, $iAuthorIp, $aVoteData, !$bVoted, $aRequestParamsData);