<div class="comment" id="comment_<?php echo $data->id; ?>"> <img class="comment-avatar" alt="" src="<?php echo $data->user->getAvatar(); ?> "> <div class="comment-body"> <div class="comment-text"> <div class="comment-heading"> <?php echo $data->user->fullname; ?> <span><?php echo MHelper::Date()->timeAgo($data->created, array('short'=>true)); ?></span> </div> </div> </div> <!-- / .comment-body --> <div class="clearfix"></div> <?php echo nl2br(CHtml::encode($data->text)); ?> </div> <!-- / .comment -->
<div class="comment" id="comment_<?php echo $model->id; ?>"> <div class="iTable"> <div class="iAvatar" style="height: 30px;"> <img class="comment-avatar" alt="" src="<?php echo $model->user->getAvatar(); ?> "> </div> <div class="iAuthor" style="min-height: 30px;"> <div class="comment-heading"> <?php echo $model->user->fullname; ?> <span><?php echo MHelper::Date()->timeAgo($model->created, array('short'=>true)); ?></span> </div> </div> </div> <div class="clearfix"></div> <div class="comment-text"> <?php echo nl2br(CHtml::encode($model->text)); ?> </div> </div> <!-- / .comment -->
public function run() { $elements = ''; $cnt = 0; $extraCss = ''; Yii::import('nfy.controllers.QueueController'); if ($this->owner instanceof QueueController) { $queueController = $this->owner; } else { $queueController = new QueueController('queue', Yii::app()->getModule('nfy')); } if(!empty($this->messages)) { foreach($this->messages as $queueName => $messages) { foreach($messages as $data) { // $text = addcslashes($message->body, "'\r\n"); $text = $data->body; $ago = MHelper::Date()->timeAgo($data->created_on, array('short'=>true)); $notification_icon = 'fa-truck bg-info'; if(!empty($data->subject_pk) && !empty($data->notification_id) && $data->class_name == 'Users'){ $user = User::model()->findByPk($data->subject_pk); if(!$user) return; $url_user = CHtml::link($user->fullname, Yii::app()->createUrl('/users/user/view', array('url' => $user->username)), array('style'=>'text-decoration:underline')); $text = str_replace('{user}', $url_user, $text); $notification_icon = 'fa-users bg-success'; } else if(!empty($data->subject_pk)){ $user = User::model()->findByPk($data->subject_pk); if(!$user) continue; $url = CHtml::link($user->username, Yii::app()->createUrl('/users/user/view', array('url' => $user->username)), array('style'=>'text-decoration:underline')); $text = str_replace('{user}', $url, $text); } $detailsUrl = $queueController->createMessageUrl($queueName, $data); $elements .= '<div class="notification">'; $elements .= '<div class="notification-title text-info">'.Yii::t('site','New contact').'</div>'; $elements .= '<div class="notification-description">'.$text.'</div> <div class="notification-ago">'.$ago.'</div> <div class="notification-icon fa '.$notification_icon.'"></div> </div>'; } } } $label = Yii::t('NfyModule.app', 'Mark all as read'); //! @todo fix this //$deleteUrl = $this->owner->createUrl('/nfy/message/mark'); $widgetId = $this->getId(); $this->elements = $elements; }