Cheetah
ChWsbAlertsResponseProfile.php
Go to the documentation of this file.
1 <?php
2 
8 ch_import('ChWsbTags');
9 ch_import('ChWsbAlerts');
10 ch_import('ChWsbProfilesController');
11 
13 {
14  function __construct()
15  {
16  parent::__construct();
17  }
18 
19  function response($oAlert)
20  {
21  $sMethodName = '_process' . ucfirst($oAlert->sUnit) . str_replace(' ', '', ucwords(str_replace('_', ' ', $oAlert->sAction)));
22  if(method_exists($this, $sMethodName))
23  $this->$sMethodName($oAlert);
24  }
25 
27 
29  {
30  $oPC = new ChWsbProfilesController();
31 
32  //--- reparse profile tags
33  $oTags = new ChWsbTags();
34  $oTags->reparseObjTags('profile', $oAlert->iObject);
35 
36  //--- send new user notification
37  if(getParam('newusernotify') == 'on' )
38  $oPC->sendNewUserNotify($oAlert->iObject);
39 
40  //--- Promotional membership
41  if(getParam('enable_promotion_membership') == 'on') {
42  $iMemershipDays = getParam('promotion_membership_days');
43  setMembership($oAlert->iObject, MEMBERSHIP_ID_PROMOTION, $iMemershipDays, true);
44  }
45  }
46 
48 
50 
52 
54  {
55  //--- reparse profile tags
56  $oTags = new ChWsbTags();
57  $oTags->reparseObjTags('profile', $oAlert->iObject);
58  }
59 
61  {
62  $oPC = new ChWsbProfilesController();
63  if(getParam('unregisterusernotify') == 'on' )
64  $oPC->sendUnregisterUserNotify($oAlert->aExtras['profile_info']);
65  }
66 }
ChWsbAlertsResponse
Definition: ChWsbAlerts.php:127
ch_import
ch_import($sClassName, $aModule=array())
Definition: utils.inc.php:1218
$oAlert
$oAlert
Definition: embed.php:15
ChWsbAlertsResponseProfile\_processProfileEdit
_processProfileEdit($oAlert)
Definition: ChWsbAlertsResponseProfile.php:53
setMembership
setMembership($iMemberId, $iMembershipId, $iDays=0, $bStartsNow=false, $sTransactionId='', $isSendMail=true)
Definition: membership_levels.inc.php:561
ChWsbAlertsResponseProfile\_processProfileBeforeJoin
_processProfileBeforeJoin($oAlert)
Definition: ChWsbAlertsResponseProfile.php:26
php
ChWsbTags
Definition: ChWsbTags.php:15
ChWsbAlertsResponseProfile\response
response($oAlert)
Definition: ChWsbAlertsResponseProfile.php:19
getParam
getParam($sParamName, $bUseCache=true)
Definition: db.inc.php:130
ChWsbAlertsResponseProfile\_processProfileLogout
_processProfileLogout($oAlert)
Definition: ChWsbAlertsResponseProfile.php:51
ChWsbAlertsResponseProfile\__construct
__construct()
Definition: ChWsbAlertsResponseProfile.php:14
ChWsbAlertsResponseProfile
Definition: ChWsbAlertsResponseProfile.php:13
ChWsbProfilesController
Definition: ChWsbProfilesController.php:12
ChWsbAlertsResponseProfile\_processProfileJoin
_processProfileJoin($oAlert)
Definition: ChWsbAlertsResponseProfile.php:28
ChWsbAlertsResponseProfile\_processProfileDelete
_processProfileDelete($oAlert)
Definition: ChWsbAlertsResponseProfile.php:60
ChWsbAlertsResponseProfile\_processProfileBeforeLogin
_processProfileBeforeLogin($oAlert)
Definition: ChWsbAlertsResponseProfile.php:47
MEMBERSHIP_ID_PROMOTION
const MEMBERSHIP_ID_PROMOTION
Definition: membership_levels.inc.php:50
ChWsbAlertsResponseProfile\_processProfileLogin
_processProfileLogin($oAlert)
Definition: ChWsbAlertsResponseProfile.php:49