public function afterSave() { if ($this->isNewRecord) { Yii::log(Yum::t('A profile been created: {profile}', array('{profile}' => json_encode($this->attributes)))); } return parent::afterSave(); }
public function afterSave() { // If the user has activated email receiving, send a email if ($this->to_user->privacy && $this->to_user->privacy->message_new_message) { Yum::log(Yum::t('Message id {id} has been sent from user {from_user_id} to user {to_user_id}', array('{id}' => $this->id, '{from_user_id}' => $this->from_user_id, '{to_user_id}' => $this->to_user_id))); YumMailer::send($this->to_user->profile->email, $this->title, $this->message); } return parent::afterSave(); }
public function afterSave() { // If the user has activated email receiving, send a email if ($user = $this->profile->user) { if (Yum::hasModule('messages') && $user->privacy && $user->privacy->message_new_profilecomment) { Yii::import('application.modules.messages.models.YumMessage'); YumMessage::write($user, $this->user_id, Yum::t('New profile comment from {username}', array('{username}' => $this->user->username)), YumTextSettings::getText('text_profilecomment_new', array('{username}' => $this->user->username, '{message}' => $this->comment, '{link_profile}' => Yii::app()->controller->createUrl('//profile/profile/view')))); } } return parent::afterSave(); }
public function afterSave() { // If the user has activated email receiving, send a email if ($user = $this->profile->user) { if (Yum::hasModule('messages') && $user->privacy && $user->privacy->message_new_profilecomment) { Yii::import('application.modules.messages.models.YumMessage'); YumMessage::write($user, $this->user_id, Yum::t('New profile comment from {username}', array('{username}' => $this->user->username)), strtr('A new profile comment has been made from {username}: {message} <br /> <a href="{link_profile}">to my profile</a>', array('{username}' => $this->user->username, '{message}' => $this->comment, '{link_profile}' => Yii::app()->controller->createUrl('//profile/profile/view')))); } } return parent::afterSave(); }
public function afterSave() { if (Yum::hasModule('profile') && Yum::module('profile')->enablePrivacySetting) { // create a new privacy setting, if not already available $setting = YumPrivacySetting::model()->cache(500)->findByPk($this->id); if (!$setting) { $setting = new YumPrivacySetting(); $setting->user_id = $this->id; $setting->save(); } if ($this->isNewRecord) { Yum::log(Yum::t('A user has been created: user: {user}', array('{user}' => json_encode($this->attributes)))); } } return parent::afterSave(); }
public function afterSave() { return parent::afterSave(); }