Social Engine PHP Hooks

Marco Enrico
2 min readJul 13, 2019

--

Banner of the announcement at SocialEngine.com.

Since the Social Engine team decided not to retire SEPHP. I’m republishing the SEPHP guides I wrote years ago. Beginning with a list of SEPHP hooks.

Here is a complete list of SEPHP hooks and some information about each of them. Most of the names are self explanatory but you may need to examine when, where or how the event is fired and what payload it contains.

  • onAuthorizationLevelDeleteBefore — never fired in a default Social Engine PHP install. There is a hook defined in the Payment module’s manifest and a handler in Payment/Plugin/Core.php
  • onFieldsValuesSave — fired in application/modules/Fields/Form/Standard.php
  • onItemDeleteBefore and onItemDeleteAfter — fired in application/modules/Core/Model/Item/Abstract.php
  • onRenderLayoutAdmin — Fired in application/modules/Core/layouts/scripts/admin-simple.tpl
  • onRenderLayoutDefault — fired in application/modules/Core/layouts/scripts/default-simple.tpl and application/modules/Core/layouts/scripts/default.tpl
  • onRenderLayoutAdminDefaultSimple — Never fired in a default Social Engine PHP install
  • onRenderLayoutDefault — fired in application/modules/Mobi/layouts/scripts/default-simple.tpl, application/modules/Core/layouts/scripts/default-simple.tpl and application/modules/Core/layouts/scripts/default.tpl
  • onRenderLayoutDefaultSimple — fired in application/modules/Core/layouts/scripts/default-simple.tpl and application/modules/Mobi/layouts/scripts/default-simple.tpl.
  • onRenderLayoutMobileDefault — fired in application/modules/Mobi/layouts/scripts/default.tpl
  • onRenderLayoutMobileDefaultSimple — never fired in a default Social Engine PHP install. A hook is defined in the Core module’s manifest and a handler in Core/Plugin/Core.php.
  • onStatistics — fired in application/modules/Core/widgets/statistics/Controller.php
  • onUserCreateBefore — fired in application/modules/Invite/Plugin/Signup.php, application/modules/Network/Plugin/User.php, application/modules/Payment/Plugin/Signup/Subscription.php, application/modules/User/Plugin/Signup/Fields.php, application/modules/User/Plugin/Signup/Invite.php, and application/modules/User/Plugin/Signup/Photo.php
  • onFieldMetaCreate_{field type}, onFieldMetaEdit_{field type}, onFieldMetaCreate, onFieldMetaEdit — fired in application/modules/Fields/Model/DbTable/Meta.php
  • onPaymentIpn_{source type} — fired in application/modules/Payment/Plugin/Gateway/Paypal.php and application/modules/Payment/Plugin/Gateway/2Checkout.php,
  • onUserEnable — fired in application/modules/User/controllers/SignupController.php, and application/modules/User/controllers/AdminManageController.php
  • onUserSignupAfter — fired in application/modules/User/controllers/SignupController.php
  • onUserLoginBefore — fired in application/modules/User/controllers/AuthController.php
  • onUserLoginAfter — fired in application/modules/User/controllers/AuthController.php
  • onUserLogoutBefore — fired in application/modules/User/controllers/AuthController.php
  • onUserLogoutAfter — fired in application/modules/User/controllers/AuthController.php
  • onUserProfilePhotoUpload — fired in application/modules/User/controller/Edit/Controller.php
  • onItemCreateBefore, onItemCreateAfter, onItemUpdateBefore, onItemUpdateAfter, onItemDeleteBefore and onItemDeleteAfter — fired in application/Modules/Core/Model/Item/Abstract.php
  • on{ItemName}CreateBefore, on{ItemName}CreateAfter, on{ItemName}UpdateBefore, on{ItemName}UpdateAfter, on{ItemName}DeleteBefore, on{ItemName}DeleteAfter — fired in application/Modules/Core/Model/Item/Abstract.php. {ItemName} is the item name defined in the manifest in CamelCase. For example, “article_photo” in the manifest becomes “ArticlePhoto” so the create event is onArticlePhotoCreateBefore.
  • onAdminStatistics — fired in application/modules/Core/widgets/admin-statistics/Controller.php
  • getAdminNotifications — fired in application/modules/Core/widgets/admin-dashboard/Controller.php
  • onGenerateCrossDomain — fired in application/modules/Core/controllers/UtilityController.php
  • addActivity — fired in application/modules/Activity/Model/DbTable/Actions.php
  • getActivity — fired in application/modules/Activity/Model/DbTable/Actions.php

Originally published in https://social-engine-tutorials.blogsplot.com.

--

--

No responses yet